|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.opensymphony.webwork.dispatcher.mapper.CompositeActionMapper
public class CompositeActionMapper
This is an ActionMapper that could take in ActionMappers and consult each ActionMapper
in the order they are given where ActionMapper with higher order will take precedence.
ActionMappers could be configured in 2 ways :-
CompositeActionMapper() CompositeActionMapper -
CompositeActionMapper(ActionMapper[])CompositeActionMapper does this by reading in the pre-configured ActionMappers
through webwork.properties file eg. with
webwork.mapper.class=com.opensymphony.webwork.dispatcher.mapper.CompositeActionMapper webwork.compositeActionMapper.1=com.opensymphony.webwork.dispatcher.mapper.RestfulActionMapper webwork.compositeActionMapper.2=com.opensymphony.webwork.dispatcher.mapper.DefaultActionMapperWe would have configured a CompositeActionMapper, with 2 pre-configured
ActionMappers, namely
ActionMapper with a lower order will be consulted first.
Through constructor (normally for unit testing)
CompositeActionMapper does this with the pre-configured ActionMappers
passed in as an array. The order of the ActionMappers is important as they will be consulted
in order.
| Nested Class Summary | |
|---|---|
protected class |
CompositeActionMapper.ActionMapperInfo
Encapsulate the ActionMapper and its order in this CompositeActionMapper. |
| Constructor Summary | |
|---|---|
CompositeActionMapper()
Creates an instance of CompositeActionMapper, reading in the pre-configured ActionMappers
through webwork.properties file eg. |
|
CompositeActionMapper(ActionMapper[] actionMappers)
Creates an instance of CompositeActionMapper with the pre-configured ActionMappers
passed in as an array. |
|
| Method Summary | |
|---|---|
protected List |
getActionMapperInfos()
Returns a list of CompositeActionMapper.ActionMapperInfo, preconfigured in this CompositeActionMapper. |
ActionMapping |
getMapping(HttpServletRequest request)
This method will go through all the pre-configured ActionMappers in the order defined, and return
the ActionMapping of the first ActionMapper that returns a valid (non-null) ActionMapping |
String |
getUriFromActionMapping(ActionMapping mapping)
This method will go through all the pre-configured ActionMappers in the order defined, and return
the URI of the first that returns a valid (non-null) URI. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CompositeActionMapper()
CompositeActionMapper, reading in the pre-configured ActionMappers
through webwork.properties file eg. with
webwork.mapper.class=com.opensymphony.webwork.dispatcher.mapper.CompositeActionMapper webwork.compositeActionMapper.1=com.opensymphony.webwork.dispatcher.mapper.RestfulActionMapper webwork.compositeActionMapper.2=com.opensymphony.webwork.dispatcher.mapper.DefaultActionMapperWe would have configured a CompositeActionMapper, with 2 pre-configured
ActionMappers, namely
ActionMapper with a lower order will be consulted first.
public CompositeActionMapper(ActionMapper[] actionMappers)
CompositeActionMapper with the pre-configured ActionMappers
passed in as an array. The order of the ActionMappers is important as they will be consulted
in order.
actionMappers - Array of ActionMappers| Method Detail |
|---|
public ActionMapping getMapping(HttpServletRequest request)
ActionMappers in the order defined, and return
the ActionMapping of the first ActionMapper that returns a valid (non-null) ActionMapping
getMapping in interface ActionMapperrequest - HttpServletRequest
public String getUriFromActionMapping(ActionMapping mapping)
ActionMappers in the order defined, and return
the URI of the first that returns a valid (non-null) URI.
getUriFromActionMapping in interface ActionMappermapping - ActionMapping
protected List getActionMapperInfos()
CompositeActionMapper.ActionMapperInfo, preconfigured in this CompositeActionMapper.
CompositeActionMapper.ActionMapperInfo
|
WebWork Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||