com.opensymphony.webwork.dispatcher.mapper
Interface ActionMapper

All Known Implementing Classes:
CompositeActionMapper, DefaultActionMapper, RestfulActionMapper

public interface ActionMapper

The ActionMapper is responsible for providing a mapping between HTTP requests and action invocation requests and vice-versa. When given an HttpServletRequest, the ActionMapper may return null if no action invocation request maps, or it may return an ActionMapping that describes an action invocation that WebWork should attempt to try. The ActionMapper is not required to guarantee that the ActionMapping returned be a real action or otherwise ensure a valid request. This means that most ActionMappers do not need to consult WebWork's configuration to determine if a request should be mapped.

Just as requests can be mapped from HTTP to an action invocation, the opposite is true as well. However, because HTTP requests (when shown in HTTP responses) must be in String form, a String is returned rather than an actual request object.

ActionMapper should return null (getMapping(javax.servlet.http.HttpServletRequest) and getUriFromActionMapping(ActionMapping) if it cannot handle the context.

Version:
$Date: 2007-11-12 23:50:43 +0800 (Mon, 12 Nov 2007) $ $Id: ActionMapper.java 2962 2007-11-12 15:50:43Z tm_jee $
Author:
plightbo, tmjee

Method Summary
 ActionMapping getMapping(HttpServletRequest request)
          Return the ActionMapping for the given HttpServletRequest, the format of HttpServletRequest url depends on the implementation of ActionMapper, eg.
 String getUriFromActionMapping(ActionMapping mapping)
          Return the uri of the ActionMapping passed in as the argument.
 

Method Detail

getMapping

ActionMapping getMapping(HttpServletRequest request)
Return the ActionMapping for the given HttpServletRequest, the format of HttpServletRequest url depends on the implementation of ActionMapper, eg. a RestfulActionMapper might handle it differently from DefaultActionMapper.

Implementation should return null if it cannot handle the format of request (eg. if it is bad etc.) such that we could cascade ActionMapping together using CompositeActionMapper

Parameters:
request -
Returns:
ActionMapping

getUriFromActionMapping

String getUriFromActionMapping(ActionMapping mapping)
Return the uri of the ActionMapping passed in as the argument.

Implementation should return null if it cannot handle the format of request (eg. if it is bad etc.) such that we could cascade ActionMapping together using CompositeActionMapper

The parameter mapping is an instance of ActionMappingEx.

Parameters:
mapping -
Returns:
String

WebWork Project Page