| com.opensymphony.webwork.portlet.dispatcher.Jsr168Dispatcher
Jsr168Dispatcher | public class Jsr168Dispatcher extends GenericPortlet implements WebWorkStatics,PortletActionConstants(Code) | |
WebWork2 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:
author: Nils-Helge Garli author: Rainer Hermanns author: Init parameters author: author: author: author: Name | author: Description | author: Default value | author:
---|
author: author: portletNamespace | The namespace for the portlet in the xwork configuration. This author: namespace is prepended to all action lookups, and makes it possible to host multiple author: portlets in the same portlet application. If this parameter is set, the complete namespace author: will be /portletNamespace/modeNamespace/actionName | The default namespace | author: author: author: viewNamespace | Base namespace in the xwork configuration for the view portlet author: mode | The default namespace | author: author: author: editNamespace | Base namespace in the xwork configuration for the edit portlet author: mode | The default namespace | author: author: author: helpNamespace | Base namespace in the xwork configuration for the help portlet author: mode | The default namespace | author: author: author: defaultViewAction | Default action to invoke in the view portlet mode if no action is author: specified | default | author: author: author: defaultEditAction | Default action to invoke in the edit portlet mode if no action is author: specified | default | author: author: author: defaultHelpAction | Default action to invoke in the help portlet mode if no action is author: specified | default | author: author:
author: author: Example: author: author: author: <init-param> author: <!-- The view mode namespace. Maps to a namespace in the xwork config file --> author: <name>viewNamespace</name> author: <value>/view</value> author: </init-param> author: <init-param> author: <!-- The default action to invoke in view mode --> author: <name>defaultViewAction</name> author: <value>index</value> author: </init-param> author: <init-param> author: <!-- The view mode namespace. Maps to a namespace in the xwork config file --> author: <name>editNamespace</name> author: <value>/edit</value> author: </init-param> author: <init-param> author: <!-- The default action to invoke in view mode --> author: <name>defaultEditAction</name> author: <value>index</value> author: </init-param> author: <init-param> author: <!-- The view mode namespace. Maps to a namespace in the xwork config file --> author: <name>helpNamespace</name> author: <value>/help</value> author: </init-param> author: <init-param> author: <!-- The default action to invoke in view mode --> author: <name>defaultHelpAction</name> author: <value>index</value> author: </init-param> author: author:
|
Method Summary | |
public HashMap | createContextMap(Map requestMap, Map parameterMap, Map sessionMap, Map applicationMap, PortletRequest request, PortletResponse response, PortletConfig portletConfig, Integer phase) Merges all application and portlet attributes into a single
HashMap to represent the entire Action context. | public void | destroy() | protected ActionMapping | getActionMapping(PortletRequest request) Gets the namespace of the action from the request. | String | getActionName(String actionPath) Get the action name part of the action path. | protected Map | getApplicationMap() Returns a Map of all application attributes. | String | getNamespace(String actionPath) Get the namespace part of the action path. | protected Map | getParameterMap(PortletRequest request) Returns a Map of all request parameters. | protected Map | getRequestMap(PortletRequest request) Returns a Map of all request attributes. | protected Map | getSessionMap(PortletRequest request) Returns a Map of all session attributes. | public void | init(PortletConfig cfg) | public void | processAction(ActionRequest request, ActionResponse response) Service an action from the event phase. | public void | render(RenderRequest request, RenderResponse response) Service an action from the render phase. | public void | serviceAction(PortletRequest request, PortletResponse response, ActionMapping mapping, Map requestMap, Map parameterMap, Map sessionMap, Map applicationMap, String portletNamespace, Integer phase) Loads the action and executes it. | protected void | setActionProxyFactory(ActionProxyFactory factory) Convenience method to ease testing. |
createContextMap | public HashMap createContextMap(Map requestMap, Map parameterMap, Map sessionMap, Map applicationMap, PortletRequest request, PortletResponse response, PortletConfig portletConfig, Integer phase)(Code) | | Merges all application and portlet attributes into a single
HashMap to represent the entire Action context.
Parameters: requestMap - a Map of all request attributes. Parameters: parameterMap - a Map of all request parameters. Parameters: sessionMap - a Map of all session attributes. Parameters: applicationMap - a Map of all servlet context attributes. Parameters: request - the PortletRequest object. Parameters: response - the PortletResponse object. Parameters: portletConfig - the PortletConfig object. Parameters: phase - The portlet phase (render or action, seePortletActionConstants) a HashMap representing the Action context. |
destroy | public void destroy()(Code) | | See Also: javax.portlet.GenericPortlet.destroy |
getActionMapping | protected ActionMapping getActionMapping(PortletRequest request)(Code) | | 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
Parameters: request - the PortletRequest object. the namespace of the action. |
getActionName | String getActionName(String actionPath)(Code) | | Get the action name part of the action path.
Parameters: actionPath - Full path to action The action name. |
getApplicationMap | protected Map getApplicationMap()(Code) | | Returns a Map of all application attributes. Copies all attributes from
the
PortletActionContext into an
ApplicationMap .
a Map of all application attributes. |
getNamespace | String getNamespace(String actionPath)(Code) | | Get the namespace part of the action path.
Parameters: actionPath - Full path to action The namespace part. |
getParameterMap | protected Map getParameterMap(PortletRequest request) throws IOException(Code) | | Returns a Map of all request parameters. This implementation just calls
PortletRequest.getParameterMap .
Parameters: request - the PortletRequest object. a Map of all request parameters. throws: IOException - if an exception occurs while retrieving the parametermap. |
getRequestMap | protected Map getRequestMap(PortletRequest request)(Code) | | 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.
Parameters: request - the PortletRequest object. a Map of all request attributes. |
getSessionMap | protected Map getSessionMap(PortletRequest request)(Code) | | 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.
Parameters: request - the PortletRequest object. a Map of all session attributes. |
init | public void init(PortletConfig cfg) throws PortletException(Code) | | Initialize the portlet with the init parameters from portlet.xml
|
processAction | public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException(Code) | | Service an action from the event phase.
See Also: javax.portlet.Portlet.processAction(javax.portlet.ActionRequestjavax.portlet.ActionResponse) |
render | public void render(RenderRequest request, RenderResponse response) throws PortletException, IOException(Code) | | Service an action from the render phase.
See Also: javax.portlet.Portlet.render(javax.portlet.RenderRequestjavax.portlet.RenderResponse) |
serviceAction | public void serviceAction(PortletRequest request, PortletResponse response, ActionMapping mapping, Map requestMap, Map parameterMap, Map sessionMap, Map applicationMap, String portletNamespace, Integer phase) throws PortletException(Code) | | 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.
Parameters: request - the HttpServletRequest object. Parameters: response - the HttpServletResponse object. Parameters: mapping - the action mapping. Parameters: requestMap - a Map of request attributes. Parameters: parameterMap - a Map of request parameters. Parameters: sessionMap - a Map of all session attributes. Parameters: applicationMap - a Map of all application attributes. Parameters: portletNamespace - the namespace or context of the action. Parameters: phase - The portlet phase (render or action, seePortletActionConstants) |
setActionProxyFactory | protected void setActionProxyFactory(ActionProxyFactory factory)(Code) | | Convenience method to ease testing.
Parameters: factory - |
|
|