|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.webwork.dispatcher.DispatcherUtils
public class DispatcherUtils
A utility class whereby FilterDispatcher delegate most of its tasks to. A static
singleton that gets initlialized upon the call to it's
initalize(ServletContext)
method
FilterDispatcher
Nested Class Summary | |
---|---|
class |
DispatcherUtils.Locator
Simple accessor for a static method |
Field Summary | |
---|---|
protected boolean |
devMode
|
protected boolean |
paramsWorkaroundEnabled
|
Constructor Summary | |
---|---|
protected |
DispatcherUtils(ServletContext servletContext)
|
Method Summary | |
---|---|
void |
cleanup()
|
Map |
createContextMap(HttpServletRequest request,
HttpServletResponse response,
ActionMapping mapping,
ServletContext context)
|
HashMap |
createContextMap(Map requestMap,
Map parameterMap,
Map sessionMap,
Map applicationMap,
HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
Merges all application and servlet attributes into a single HashMap to represent the entire Action context. |
static DispatcherUtils |
getInstance()
|
static int |
getMaxSize()
Returns the maximum upload size allowed for multipart requests (this is configurable). |
String |
getSaveDir(ServletContext servletContext)
Returns the path to save uploaded files to (this is configurable). |
protected void |
init(ServletContext servletContext)
|
static void |
initialize(ServletContext servletContext)
|
static boolean |
isPortletSupportActive()
Returns true, if portlet support is active, false otherwise. |
void |
prepare(HttpServletRequest request,
HttpServletResponse response)
|
void |
sendError(HttpServletRequest request,
HttpServletResponse response,
ServletContext ctx,
int code,
Exception e)
Sends an HTTP error response code. |
void |
serviceAction(HttpServletRequest request,
HttpServletResponse response,
ServletContext context,
ActionMapping mapping)
Loads the action and executes it. |
static void |
setInstance(DispatcherUtils instance)
|
static void |
setPortletSupportActive(boolean portletSupportActive)
Set the flag that portlet support is active or not. |
HttpServletRequest |
wrapRequest(HttpServletRequest request,
ServletContext servletContext)
Wraps and returns the given response or returns the original response object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean devMode
protected boolean paramsWorkaroundEnabled
Constructor Detail |
---|
protected DispatcherUtils(ServletContext servletContext)
Method Detail |
---|
public static void initialize(ServletContext servletContext)
public static DispatcherUtils getInstance()
public static void setInstance(DispatcherUtils instance)
public void cleanup()
protected void init(ServletContext servletContext)
public void serviceAction(HttpServletRequest request, HttpServletResponse response, ServletContext context, ActionMapping mapping) throws ServletException
sendError(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.ServletContext, int, java.lang.Exception)
method, using the 404 return code.
All other errors are reported by throwing a ServletException.
request
- the HttpServletRequest objectresponse
- the HttpServletResponse objectmapping
- the action mapping object
ServletException
- when an unknown error occurs (not a 404, but typically something that
would end up as a 5xx by the servlet container)public Map createContextMap(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping, ServletContext context)
public HashMap createContextMap(Map requestMap, Map parameterMap, Map sessionMap, Map applicationMap, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
requestMap
- a Map of all request attributes.parameterMap
- a Map of all request parameters.sessionMap
- a Map of all session attributes.applicationMap
- a Map of all servlet context attributes.request
- the HttpServletRequest object.response
- the HttpServletResponse object.servletContext
- the ServletContext object.
public static int getMaxSize()
public String getSaveDir(ServletContext servletContext)
public void prepare(HttpServletRequest request, HttpServletResponse response)
public HttpServletRequest wrapRequest(HttpServletRequest request, ServletContext servletContext) throws IOException
MultiPartRequestWrapper
is
flexible - you should look to that first before overriding this method to handle multipart data.
request
- the HttpServletRequest object.
IOException
MultiPartRequestWrapper
public void sendError(HttpServletRequest request, HttpServletResponse response, ServletContext ctx, int code, Exception e)
request
- the HttpServletRequest object.response
- the HttpServletResponse object.code
- the HttpServletResponse error code (see HttpServletResponse
for possible error codes).e
- the Exception that is reported.public static boolean isPortletSupportActive()
public static void setPortletSupportActive(boolean portletSupportActive)
portletSupportActive
- true or false
|
WebWork Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |