Overview Package Class Tree Serialized Deprecated Index Help PREV class NEXT class SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
com.ibm.portal.struts.portlet
Class WpRequestProcessorjava.lang.Object org.apache.struts.action.RequestProcessor com.ibm.portal.struts.portlet.WpRequestProcessor
- Direct Known Subclasses:
- WpTilesRequestProcessor
- public class WpRequestProcessor
- extends org.apache.struts.action.RequestProcessor
WpRequestProcessor contains the processing logic that the Struts controller portlet performs as it receives each request from the container. The WpRequestProcessor is a customized version of the base Struts RequestProcessor to allow the Struts application to execute in Portal. This class or subclasses must be the Struts request processor used for Struts applications in portal. The WpRequestProcessor class can be extended to support customizing the Struts processing in Portal, but the super method implementations should be invoked.
- Since:
- 5.1
Field Summary protected static org.apache.commons.logging.Log log
Commons Logging instance for this classprotected static org.apache.struts.util.MessageResources messages
The message resources for the Struts Portlet Framework.
Fields inherited from class org.apache.struts.action.RequestProcessor actions, appConfig, INCLUDE_PATH_INFO, INCLUDE_SERVLET_PATH, moduleConfig, servlet
Constructor Summary WpRequestProcessor()
WpRequestProcessor constructor
Method Summary protected void doForward(java.lang.String uri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Forwards are not directly supported in Portal.protected void doInclude(java.lang.String uri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Do an include of specified uri.java.lang.String getApplicationPrefix()
Get the application prefix associated with this command processor.protected com.ibm.portal.struts.common.ModuleContext getModuleContext()
Return the module context objectprotected javax.servlet.ServletContext getServletContext()
Returns the servlet context objectStrutsInfo getStrutsInfo()
Get the StrutsInfo object associated with this command processor.void init(org.apache.struts.action.ActionServlet servlet, org.apache.struts.config.ModuleConfig moduleConfig)
Initialize this request processor instance.protected org.apache.struts.action.ActionForward processActionPerform(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.Action action, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping)
Ask the specified Action instance to handle this request.protected void processContent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Override the default function to do nothing since we set the content type elsewhere.protected org.apache.struts.action.ActionForward processException(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Exception exception, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping)
This implementation calls the super implementation.protected void processForwardConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.config.ForwardConfig forward)
This implementation will process the ForwardConfig and then call doFoward.protected org.apache.struts.action.ActionMapping processMapping(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String path)
Calls the super processMapping implementation.protected javax.servlet.http.HttpServletRequest processMultipart(javax.servlet.http.HttpServletRequest request)
If this is a multipart request, wrap it with a special wrapper.static void processNewActionUri(java.lang.String uri, javax.portlet.PortletRequest request, javax.portlet.PortletResponse response, javax.servlet.ServletContext servletContext)
This method will implement the necessary steps to simulate a forward to a Struts Action.protected void processNoCache(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
This method does not call the Struts Request Processor processNoCache implementation.protected void processPopulate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping)
Calls the inherited processPopulate.protected boolean processRoles(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionMapping mapping)
This method will call the super implementation for processing J2EE roles.protected java.lang.String processUri(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Identify and return the path component from the request URI.void setServletContext(javax.servlet.ServletContext sContext)
Set the servlet context
Methods inherited from class org.apache.struts.action.RequestProcessor destroy, getDebug, getInternal, internalModuleRelativeForward, internalModuleRelativeInclude, log, log, process, processActionCreate, processActionForm, processActionForward, processForward, processInclude, processLocale, processPath, processPreprocess, processValidate
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail messages
protected static org.apache.struts.util.MessageResources messages
- The message resources for the Struts Portlet Framework.
log
protected static org.apache.commons.logging.Log log
- Commons Logging instance for this class
Constructor Detail WpRequestProcessor
public WpRequestProcessor()
- WpRequestProcessor constructor
Method Detail processMultipart
protected javax.servlet.http.HttpServletRequest processMultipart(javax.servlet.http.HttpServletRequest request)
- If this is a multipart request, wrap it with a special wrapper. Otherwise, return the request unchanged.
- Parameters:
- request - The HttpServletRequest we are processing
- Returns:
- returns a wrapper request object if needed
init
public void init(org.apache.struts.action.ActionServlet servlet, org.apache.struts.config.ModuleConfig moduleConfig) throws javax.servlet.ServletException
- Initialize this request processor instance.
- Parameters:
- servlet - The ActionServlet we are associated with
- moduleConfig - The ModuleConfig we are associated with.
- Throws:
- javax.servlet.ServletException - If an error occor during initialization
getModuleContext
protected com.ibm.portal.struts.common.ModuleContext getModuleContext()
- Return the module context object
- Returns:
- returns the module context
processActionPerform
protected org.apache.struts.action.ActionForward processActionPerform(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.Action action, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping) throws java.io.IOException, javax.servlet.ServletException
- Ask the specified Action instance to handle this request. Return the
ActionForward instance (if any) returned by the called Action for further processing. This implementation will also check for the Portal friendly StrutsAction class and call the execute method with the portlet objects instead of the http servlet interfaces.
- Parameters:
- request - The servlet request we are processing
- response - The servlet response we are creating
- action - The Action instance to be used
- form - The ActionForm instance to pass to this Action
- mapping - The ActionMapping instance to pass to this Action
- Throws:
- java.io.IOException - if an input/output error occurs
- javax.servlet.ServletException - if a servlet exception occurs
processForwardConfig
protected void processForwardConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.config.ForwardConfig forward) throws java.io.IOException, javax.servlet.ServletException
- This implementation will process the ForwardConfig and then call doFoward. Redirects are not supported, and instead are handled as a forward. The path is modified as necessary depending on the context relative setting and the path is then passed into doForward.
- Parameters:
- request - The servlet request we are processing
- response - The servlet response we are creating
- forward - The ActionForward controlling where we go next
- Throws:
- java.io.IOException - if an input/output error occurs
- javax.servlet.ServletException - if a servlet exception occurs
processException
protected org.apache.struts.action.ActionForward processException(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Exception exception, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping) throws java.io.IOException, javax.servlet.ServletException
- This implementation calls the super implementation. If the exception is not handled and is a WpsStrutsException then response.sendError with the exception information is called.
- Parameters:
- request - The servlet request we are processing
- response - The servlet response we are processing
- exception - The exception being handled
- form - The ActionForm we are processing
- mapping - The ActionMapping we are using
- Returns:
- returns the ActionForward, can be
null
- Throws:
- java.io.IOException - if an input/output error occurs
- javax.servlet.ServletException - if a servlet exception occurs
processMapping
protected org.apache.struts.action.ActionMapping processMapping(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String path) throws java.io.IOException
- Calls the super processMapping implementation. Then the ActionMapping type is checked to see if the Action implements the IStrutsPrepareRender interface. If so the Request Processor processing stops.
- Parameters:
- request - The servlet request we are processing
- response - The servlet response we are creating
- path - The portion of the request URI for selecting a mapping
- Returns:
- returns the action mapping, can be
null
- Throws:
- java.io.IOException - if an input/output error occurs
processNoCache
protected void processNoCache(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
- This method does not call the Struts Request Processor processNoCache implementation. This method is a nop in Portal
- Parameters:
- request - The servlet request we are processing
- response - The servlet response we are creating
doForward
protected void doForward(java.lang.String uri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
- Forwards are not directly supported in Portal. This implementation calls doInclude.
- Parameters:
- uri - Uri or Definition name to forward
- request - Current page request
- response - Current page response
- Throws:
- java.io.IOException - if an input/output error occurs
- javax.servlet.ServletException - if a servlet exception occurs
doInclude
protected void doInclude(java.lang.String uri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
- Do an include of specified uri. This implementation will include files, or recursively call the RequestProcessor for Struts actions.
- Parameters:
- uri - Uri of page to include
- request - Current page request
- response - Current page response
- Throws:
- java.io.IOException - if an input/output error occurs
- javax.servlet.ServletException - if a servlet exception occurs
processNewActionUri
public static void processNewActionUri(java.lang.String uri, javax.portlet.PortletRequest request, javax.portlet.PortletResponse response, javax.servlet.ServletContext servletContext) throws java.io.IOException, javax.servlet.ServletException
- This method will implement the necessary steps to simulate a forward to a Struts Action. The appropriate Request Processor is looked up and the process method is called. The URI is the path for the Struts Action and can contain a query string. If the URI is not a path for a Struts Action, then the URI will be passed to the ViewCommandFactory.
- Parameters:
- uri - the new URI
- request - the request
- response - the response
- Throws:
- java.io.IOException - if an input/output error occurs
- javax.servlet.ServletException - if a servlet exception occurs
setServletContext
public void setServletContext(javax.servlet.ServletContext sContext)
- Set the servlet context
- Parameters:
- sContext - the servlet context object
getServletContext
protected javax.servlet.ServletContext getServletContext()
- Returns the servlet context object
- Returns:
- returns the servlet context object, can be
null if not set
getStrutsInfo
public StrutsInfo getStrutsInfo()
- Get the StrutsInfo object associated with this command processor.
- Returns:
- returns the Struts Info object
getApplicationPrefix
public java.lang.String getApplicationPrefix()
- Get the application prefix associated with this command processor.
- Returns:
- application prefix, can be
null
processRoles
protected boolean processRoles(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionMapping mapping) throws java.io.IOException, javax.servlet.ServletException
- This method will call the super implementation for processing J2EE roles. If the application was configured to use Portal Groups instead then the ActionMapping roles are compared to the user's Portal groups.
- Parameters:
- request - The servlet request we are processing
- response - The servlet response we are creating
- mapping - The mapping we are using
- Throws:
- java.io.IOException - if an input/output error occurs
- javax.servlet.ServletException - if a servlet exception occurs
processPopulate
protected void processPopulate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping) throws javax.servlet.ServletException
- Calls the inherited processPopulate. If file upload is used and the max length exceeded is detected then this method will get the request input stream and reads the byte stream.
- Parameters:
- request - The servlet request we are processing
- response - The servlet response we are creating
- form - The ActionForm instance we are populating
- mapping - The ActionMapping we are using
- Throws:
- javax.servlet.ServletException - if thrown by RequestUtils.populate()
processUri
protected java.lang.String processUri(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
- Identify and return the path component from the request URI. The path will include the extension mapping. If no such path can be identified, create an error response and return
null.
- Parameters:
- request - The servlet request we are processing
- response - The servlet response we are creating
- Throws:
- java.io.IOException - if an input/output error occurs
processContent
protected void processContent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
- Override the default function to do nothing since we set the content type elsewhere.
- See Also:
- StrutsViewCommand.execute(RenderRequest, RenderResponse, ViewCommandExecutionContext), RequestProcessor.processContent(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
Overview Package Class Tree Serialized Deprecated Index Help PREV class NEXT class SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.