groovy.servlet
public class ServletBinding extends Binding
request.getSession(false) - can be null!
If response.getWriter() is called directly (without using out), then a write method call on 'sout' will not cause the IllegalStateException, but it will still be invalid. It is the responsibility of the user of this class, to not to mix these different usage styles. The same applies to calling response.getOoutputStream() and using 'out' or 'html'.
| Constructor and Description |
|---|
ServletBinding(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext context)
Initializes a servlet binding.
|
| Modifier and Type | Method and Description |
|---|---|
void |
forward(java.lang.String path) |
java.lang.Object |
getVariable(java.lang.String name) |
java.util.Map |
getVariables() |
void |
include(java.lang.String path) |
void |
redirect(java.lang.String location) |
void |
setVariable(java.lang.String name,
java.lang.Object value)
Sets the value of the given variable
|
getProperty, setPropertygetMetaClass, invokeMethod, setMetaClasspublic ServletBinding(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext context)
request - the HttpServletRequest objectresponse - the HttpServletRequest objectcontext - the ServletContext objectpublic void setVariable(java.lang.String name,
java.lang.Object value)
BindingsetVariable in class Bindingname - the name of the variable to setvalue - the new value for the given variablepublic java.util.Map getVariables()
getVariables in class Bindingpublic java.lang.Object getVariable(java.lang.String name)
getVariable in class Bindingname - the name of the variable to lookuppublic void forward(java.lang.String path)
throws javax.servlet.ServletException,
java.io.IOException
javax.servlet.ServletExceptionjava.io.IOExceptionpublic void include(java.lang.String path)
throws javax.servlet.ServletException,
java.io.IOException
javax.servlet.ServletExceptionjava.io.IOExceptionpublic void redirect(java.lang.String location)
throws java.io.IOException
java.io.IOException