org.apache.struts2.dispatcher.mapper
类 PrefixBasedActionMapper

java.lang.Object
  继承者 org.apache.struts2.dispatcher.mapper.DefaultActionMapper
      继承者 org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper
所有已实现的接口:
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="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
 <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.

另请参见:
ActionMapper, ActionMapping

构造方法摘要
PrefixBasedActionMapper()
           
 
方法摘要
 ActionMapping getMapping(javax.servlet.http.HttpServletRequest request, com.opensymphony.xwork2.config.ConfigurationManager configManager)
          Expose the ActionMapping for the current request
 String getUriFromActionMapping(ActionMapping mapping)
          Convert an ActionMapping into a URI string
 void setContainer(com.opensymphony.xwork2.inject.Container container)
           
 void setPrefixBasedActionMappers(String list)
           
 
从类 org.apache.struts2.dispatcher.mapper.DefaultActionMapper 继承的方法
getMappingFromActionName, handleSpecialParameters, isSlashesInActionNames, setAllowActionCrossNamespaceAccess, setAllowActionPrefix, setAllowDynamicMethodCalls, setAllowedActionNames, setAlwaysSelectFullNamespace, setExtensions, setSlashesInActionNames
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
从接口 org.apache.struts2.dispatcher.mapper.ActionMapper 继承的方法
getMappingFromActionName
 

构造方法详细信息

PrefixBasedActionMapper

public PrefixBasedActionMapper()
方法详细信息

setContainer

public void setContainer(com.opensymphony.xwork2.inject.Container container)
覆盖:
DefaultActionMapper 中的 setContainer

setPrefixBasedActionMappers

public void setPrefixBasedActionMappers(String list)

getMapping

public ActionMapping getMapping(javax.servlet.http.HttpServletRequest request,
                                com.opensymphony.xwork2.config.ConfigurationManager configManager)
从接口 ActionMapper 复制的描述
Expose the ActionMapping for the current request

指定者:
接口 ActionMapper 中的 getMapping
覆盖:
DefaultActionMapper 中的 getMapping
参数:
request - The servlet request
configManager - The current configuration manager
返回:
The appropriate action mapping or null if mapping cannot be determined

getUriFromActionMapping

public String getUriFromActionMapping(ActionMapping mapping)
从接口 ActionMapper 复制的描述
Convert an ActionMapping into a URI string

指定者:
接口 ActionMapper 中的 getUriFromActionMapping
覆盖:
DefaultActionMapper 中的 getUriFromActionMapping
参数:
mapping - The action mapping
返回:
The URI string that represents this mapping