|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Encapsulates several critical request-related resources that are accessed
frequently throughout the JATO infrastructure and JATO applications. Most
importantly, the RequestContext
encapsulates the current request's
HttpServletRequest
and HttpServletResponse
objects.
Without a container like RequestContext
, the JATO framework and
JATO developers would have to independently pass the encapsulated resources
into every method that might need them. By aggregating the resources into one
logical container, we have simplified access to these objects, and guaranteed
that all objects in the request have easy and predictable access to these vital
resources.
JATO creates a new instance of RequestContext
for each request.
Requests that attempt to bypass the JATO request handling infrastructure
(contained in ApplicationServletBase
) and directly invoke a JATO
application's JSP pages directly will fail due to the lack of properly
initialized RequestContext
. This represents a desirable security
model.
It is entirely possible for developers to provide an implementation of the
RequestContext
interface to make other application- or enterprise-
critical resources available wherever the request context is available. Examples
of such a use might be to provide security context or user profile objects.
RequestContextImpl
Field Summary | |
static int |
DISPLAY_PHASE
Indicates the display portion of a request, after the request has been forwarded to a resource for output to the client |
static int |
SUBMIT_PHASE
Indicates the request handling portion of a request, before the request has been forwarded to a resource for output to the client |
Method Summary | |
void |
addRequestCompletionListener(RequestCompletionListener listener)
Adds a request completion listener to the current request. |
java.lang.StringBuffer |
getMessageBuffer()
Returns the buffer of accumulated messages. |
java.io.PrintWriter |
getMessageWriter()
Returns a PrintWriter that can be used to output
application information to the bottom of the rendered HTML resonse. |
ModelManager |
getModelManager()
Returns the request's ModelManager |
javax.servlet.http.HttpServletRequest |
getRequest()
Returns the request object for the current request |
int |
getRequestPhase()
Returns a code for the current phase the request is in. |
javax.servlet.http.HttpServletResponse |
getResponse()
Returns the response object for the current request |
javax.servlet.ServletContext |
getServletContext()
Returns the request handling servlet's ServletContext |
java.lang.String |
getServletName()
Returns the request handling servlet's logical name |
SQLConnectionManager |
getSQLConnectionManager()
Returns the request's SQLConnectionManager |
ViewBeanManager |
getViewBeanManager()
Returns the request's ViewBeanManager |
boolean |
hasMessages()
Returns true if any messages have been written to the message buffer |
void |
removeRequestCompletionListener(RequestCompletionListener listener)
Removes a request completion listener from the request context. |
Field Detail |
public static final int SUBMIT_PHASE
public static final int DISPLAY_PHASE
Method Detail |
public java.lang.String getServletName()
public javax.servlet.ServletContext getServletContext()
ServletContext
public javax.servlet.http.HttpServletRequest getRequest()
public javax.servlet.http.HttpServletResponse getResponse()
public ViewBeanManager getViewBeanManager()
ViewBeanManager
public ModelManager getModelManager()
ModelManager
public java.io.PrintWriter getMessageWriter()
PrintWriter
that can be used to output
application information to the bottom of the rendered HTML resonse.
Anything printed through this object will be buffered and then
appended in a block following the flushing of the response. This
mechanism is intended as a development time aid, a means of attaching
application information to the relevant page.public boolean hasMessages()
public java.lang.StringBuffer getMessageBuffer()
getMessageWriter()
method.public SQLConnectionManager getSQLConnectionManager()
SQLConnectionManager
public void addRequestCompletionListener(RequestCompletionListener listener)
listener
- The object wishing to be notified of the end of the requestpublic void removeRequestCompletionListener(RequestCompletionListener listener)
listener
- The object wishing to be removed from the notification listpublic int getRequestPhase()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |