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(HttpServletRequest request,
HttpServletResponse response,
ServletContext context)
Initializes a servlet binding.
|
Modifier and Type | Method and Description |
---|---|
void |
forward(String path) |
Object |
getVariable(String name) |
Map |
getVariables() |
void |
include(String path) |
void |
redirect(String location) |
void |
setVariable(String name,
Object value)
Sets the value of the given variable
|
getProperty, setProperty
getMetaClass, invokeMethod, setMetaClass
public ServletBinding(HttpServletRequest request, HttpServletResponse response, ServletContext context)
request
- the HttpServletRequest objectresponse
- the HttpServletRequest objectcontext
- the ServletContext objectpublic void setVariable(String name, Object value)
Binding
setVariable
in class Binding
name
- the name of the variable to setvalue
- the new value for the given variablepublic Map getVariables()
getVariables
in class Binding
public Object getVariable(String name)
getVariable
in class Binding
name
- the name of the variable to lookuppublic void forward(String path) throws ServletException, IOException
ServletException
IOException
public void include(String path) throws ServletException, IOException
ServletException
IOException
public void redirect(String location) throws IOException
IOException