Class PrefixBasedActionMapper
java.lang.Object
org.apache.struts2.dispatcher.mapper.DefaultActionMapper
org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper
- All Implemented Interfaces:
- 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:
- 
Field SummaryFieldsFields inherited from class org.apache.struts2.dispatcher.mapper.DefaultActionMapperACTION_PREFIX, allowDynamicMethodCalls, allowedActionNames, allowedMethodNames, allowedNamespaceNames, allowSlashesInActionNames, alwaysSelectFullNamespace, defaultActionName, defaultMethodName, defaultNamespaceName, extensions, METHOD_PREFIX, prefixTrie
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetMapping(jakarta.servlet.http.HttpServletRequest request, ConfigurationManager configManager) Expose the ActionMapping for the current requestgetUriFromActionMapping(ActionMapping mapping) Convert an ActionMapping into a URI stringvoidsetContainer(Container container) voidMethods inherited from class org.apache.struts2.dispatcher.mapper.DefaultActionMapperaddParameterAction, cleanupActionName, cleanupMethodName, cleanupNamespaceName, dropExtension, extractMethodName, getDefaultExtension, getMappingFromActionName, handleDynamicMethod, handleExtension, handleName, handleNamespace, handleParams, handleSpecialParameters, isSlashesInActionNames, lookupExtension, parseActionName, parseNameAndNamespace, setAllowActionPrefix, setAllowDynamicMethodCalls, setAllowedActionNames, setAllowedMethodNames, setAllowedNamespaceNames, setAlwaysSelectFullNamespace, setDefaultActionName, setDefaultMethodName, setDefaultNamespaceName, setExtensions, setSlashesInActionNamesMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.struts2.dispatcher.mapper.ActionMappergetMappingFromActionName
- 
Field Details- 
container
- 
actionMappers
 
- 
- 
Constructor Details- 
PrefixBasedActionMapperpublic PrefixBasedActionMapper()
 
- 
- 
Method Details- 
setContainer- Overrides:
- setContainerin class- DefaultActionMapper
 
- 
setPrefixBasedActionMappers
- 
getMappingpublic ActionMapping getMapping(jakarta.servlet.http.HttpServletRequest request, ConfigurationManager configManager) Description copied from interface:ActionMapperExpose the ActionMapping for the current request- Specified by:
- getMappingin interface- ActionMapper
- Overrides:
- getMappingin class- DefaultActionMapper
- Parameters:
- request- The servlet request
- configManager- The current configuration manager
- Returns:
- The appropriate action mapping or null if mapping cannot be determined
 
- 
getUriFromActionMappingDescription copied from interface:ActionMapperConvert an ActionMapping into a URI string- Specified by:
- getUriFromActionMappingin interface- ActionMapper
- Overrides:
- getUriFromActionMappingin class- DefaultActionMapper
- Parameters:
- mapping- The action mapping
- Returns:
- The URI string that represents this mapping
 
 
-