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 ActionMapper
s 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
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 requestconfigManager
- 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