Home » struts-2.1.8.1-src » org.apache » struts2 » portlet » dispatcher » [javadoc | source]
org.apache.struts2.portlet.dispatcher
public class: Jsr168Dispatcher [javadoc | source]
java.lang.Object
   javax.portlet.GenericPortlet
      org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher

All Implemented Interfaces:
    PortletActionConstants, StrutsStatics

Struts JSR-168 portlet dispatcher. Similar to the WW2 Servlet dispatcher, but adjusted to a portal environment. The portlet is configured through the portlet.xml descriptor. Examples and descriptions follow below:

Method from org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher Summary:
createContextMap,   destroy,   getActionMapping,   getActionName,   getApplicationMap,   getNamespace,   getParameterMap,   getRequestMap,   getSessionMap,   init,   parseModeConfig,   processAction,   render,   serviceAction,   setActionMapper,   setActionProxyFactory
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher Detail:
 public HashMap<String, Object> createContextMap(Map<String, Object> requestMap,
    Map<String, String> parameterMap,
    Map<String, Object> sessionMap,
    Map<String, Object> applicationMap,
    PortletRequest request,
    PortletResponse response,
    HttpServletRequest servletRequest,
    HttpServletResponse servletResponse,
    ServletContext servletContext,
    PortletConfig portletConfig,
    Integer phase) throws IOException 
    Merges all application and portlet attributes into a single HashMap to represent the entire Action context.
 public  void destroy() 
 protected ActionMapping getActionMapping(PortletRequest portletRequest,
    HttpServletRequest servletRequest) 
    Gets the namespace of the action from the request. The namespace is the same as the portlet mode. E.g, view mode is mapped to namespace view, and edit mode is mapped to the namespace edit
 String getActionName(String actionPath) 
    Get the action name part of the action path.
 protected Map getApplicationMap() 
 String getNamespace(String actionPath) 
    Get the namespace part of the action path.
 protected Map<String, String> getParameterMap(PortletRequest request) throws IOException 
 protected Map getRequestMap(PortletRequest request) 
    Returns a Map of all request attributes. The default implementation is to wrap the request in a RequestMap . Override this method to customize how request attributes are mapped.
 protected Map getSessionMap(PortletRequest request) 
    Returns a Map of all session attributes. The default implementation is to wrap the reqeust in a SessionMap . Override this method to customize how session attributes are mapped.
 public  void init(PortletConfig cfg) throws PortletException 
    Initialize the portlet with the init parameters from portlet.xml
  void parseModeConfig(Map<PortletMode, ActionMapping> actionMap,
    PortletConfig portletConfig,
    PortletMode portletMode,
    String nameSpaceParam,
    String defaultActionParam) 
    Parse the mode to namespace mappings configured in portlet.xml
 public  void processAction(ActionRequest request,
    ActionResponse response) throws PortletException, IOException 
    Service an action from the event phase.
 public  void render(RenderRequest request,
    RenderResponse response) throws PortletException, IOException 
    Service an action from the render phase.
 public  void serviceAction(PortletRequest request,
    PortletResponse response,
    Map<String, Object> requestMap,
    Map<String, String> parameterMap,
    Map<String, Object> sessionMap,
    Map<String, Object> applicationMap,
    String portletNamespace,
    Integer phase) throws PortletException 
    Loads the action and executes it. This method first creates the action context from the given parameters then loads an ActionProxy from the given action name and namespace. After that, the action is executed and output channels throught the response object.
 public  void setActionMapper(ActionMapper actionMapper) 
 protected  void setActionProxyFactory(ActionProxyFactory factory) 
    Convenience method to ease testing.