|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.scopemvc.controller.basic.ViewContext | +--org.scopemvc.controller.servlet.ServletContext
A ViewContext
that handles
showView(), hideView() and showError() for servlet implementations.
The showView() expects a ServletView that is asked to stream the currently visible Page to the HTTP Response's OutputStream.
Two interesting behaviours can be customized with a ServletContext subclass:
showError(java.lang.String, java.lang.String)
to implement the required behaviour. ScopeServlet.createServletContext(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.util.HashMap)
in the application's ScopeServlet subclass
to return an instance of the custom ServletContext.
JSPContext
,
XSLServletContext
Field Summary | |
protected java.util.HashMap |
formParameters
TODO: describe of the Field |
protected javax.servlet.http.HttpServletRequest |
request
TODO: describe of the Field |
protected javax.servlet.http.HttpServletResponse |
response
The HttpServletResponse to use on showView. |
protected ScopeServlet |
servlet
TODO: describe of the Field |
Constructor Summary | |
ServletContext(ScopeServlet inServlet,
javax.servlet.http.HttpServletRequest inRequest,
javax.servlet.http.HttpServletResponse inResponse,
java.util.HashMap inFormParameters)
Create with an HttpServletResponse to use on a showView during initialisation, and a HttpServletRequest accessible to application code. |
Method Summary | |
void |
exit()
Used by default BasicController's handler for the EXIT Control. |
protected java.lang.String |
formatMessageToHTML(java.lang.String inMessage)
Replace all low ASCII chars (<32) in the message with <BR />. |
java.util.HashMap |
getFormParameters()
|
javax.servlet.http.HttpServletRequest |
getHttpRequest()
Allow access to the request object. |
javax.servlet.http.HttpServletResponse |
getHttpResponse()
Allow access to the response object. |
ScopeServlet |
getServlet()
Return the ScopeServlet that handled this context's request. |
protected void |
handleInternalError(java.lang.Throwable t)
Got an error while streaming the view into the response OutputStream. |
boolean |
hasShownView()
TODO: document the method |
void |
hideView(View inView)
Don't do anything in this impl. |
protected void |
setHttpResponse(javax.servlet.http.HttpServletResponse inResponse)
The response to use for showView. |
void |
showError(java.lang.String inErrorTitle,
java.lang.String inErrorMessage)
This is a very simple default error handler. |
abstract void |
showView(View inView)
Show the ServletView passed. |
void |
startProgress()
TODO: document the method |
void |
stopProgress()
TODO: document the method |
Methods inherited from class org.scopemvc.controller.basic.ViewContext |
addProperty, clearProperties, clearThreadContext, getProperty, getViewContext, removeProperty, setGlobalContext, setThreadContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected javax.servlet.http.HttpServletResponse response
protected javax.servlet.http.HttpServletRequest request
protected java.util.HashMap formParameters
protected ScopeServlet servlet
Constructor Detail |
public ServletContext(ScopeServlet inServlet, javax.servlet.http.HttpServletRequest inRequest, javax.servlet.http.HttpServletResponse inResponse, java.util.HashMap inFormParameters)
inServlet
- TODO: Describe the ParameterinRequest
- TODO: Describe the ParameterinResponse
- TODO: Describe the ParameterinFormParameters
- TODO: Describe the ParameterMethod Detail |
public final javax.servlet.http.HttpServletResponse getHttpResponse()
public final javax.servlet.http.HttpServletRequest getHttpRequest()
public final ScopeServlet getServlet()
public final java.util.HashMap getFormParameters()
public final boolean hasShownView()
public abstract void showView(View inView)
showView
in class ViewContext
inView
- TODO: Describe the Parameterpublic void hideView(View inView)
***** A nicer impl of this view manager would maintain a "stack" of shown views and implement "doHideView" to step back through the stack if available. Could be tied to some rudimentary state management in ScopeServlet.
hideView
in class ViewContext
inView
- TODO: Describe the Parameterpublic void showError(java.lang.String inErrorTitle, java.lang.String inErrorMessage)
ScopeServlet.createServletContext(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.util.HashMap)
to return an instance of your custom
ServletContext that will handle servlet requests.
showError
in class ViewContext
inErrorTitle
- TODO: Describe the ParameterinErrorMessage
- TODO: Describe the Parameterpublic void exit()
exit
in class ViewContext
public void startProgress()
startProgress
in class ViewContext
public void stopProgress()
stopProgress
in class ViewContext
protected final void setHttpResponse(javax.servlet.http.HttpServletResponse inResponse)
inResponse
- The new httpResponse valueprotected void handleInternalError(java.lang.Throwable t) throws java.io.IOException
t
- TODO: Describe the Parameter
java.io.IOException
- TODO: Describe the Exceptionprotected java.lang.String formatMessageToHTML(java.lang.String inMessage)
inMessage
- TODO: Describe the Parameter
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |