Class PrefixBasedActionMapper

java.lang.Object
org.apache.struts2.dispatcher.mapper.DefaultActionMapper
org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper
All Implemented Interfaces:
ActionMapper

public class PrefixBasedActionMapper extends DefaultActionMapper implements ActionMapper

A prefix based action mapper that is capable of delegating to other ActionMappers based on the request's prefix.
It is configured through struts.xml
For example, with the following entries in struts.properties

 <constant name="struts.mapper.class" value="prefix"/>
 <constant name="struts.mapper.prefixMapping" value="/communities:pseudoRestful,/communityTags:pseudoRestful,/events:pseudoRestful,/mediaList:pseudoRestful,/users:pseudoRestful,/community:struts,/communityTag:struts,/event:struts,/media:struts,/user:struts,:struts"/>
 

When getMapping(HttpServletRequest, ConfigurationManager) or getUriFromActionMapping(ActionMapping) is invoked, PrefixBasedActionMapper will check each possible prefix (url prefix terminating just before a /) to find the most specific ActionMapper that returns a mapping when asked to map the request. If none are found, null is returned for both getMapping(HttpServletRequest, ConfigurationManager) and getUriFromActionMapping(ActionMapping) methods.

See Also: