This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch restful in repository https://gitbox.apache.org/repos/asf/struts-site.git
commit 9c1e22d65dadb4cea0689afe8e10ef5e03b0dc7b Author: Lukasz Lenart <lukaszlen...@apache.org> AuthorDate: Fri Dec 8 08:14:31 2017 +0100 Cleans up page --- source/core-developers/action-mapper.md | 93 ++++++++++++--------------------- 1 file changed, 33 insertions(+), 60 deletions(-) diff --git a/source/core-developers/action-mapper.md b/source/core-developers/action-mapper.md index a68d84d..1640acd 100644 --- a/source/core-developers/action-mapper.md +++ b/source/core-developers/action-mapper.md @@ -133,74 +133,47 @@ and "restful" which is `org.apache.struts2.dispatcher.mapper.RestfulActionMapper ## PrefixBasedActionMapper -{% comment %}start snippet id=description|javadoc=true|url=org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper {% endcomment %} -<p> <p> +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.xml`: - A prefix based action mapper that is capable of delegating to other {@link ActionMapper}s based on the request's prefix.<br> - - It is configured through struts.xml<br> - - For example, with the following entries in struts.properties - - </p> - - - - <pre> - - <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"/> - - </pre> - - - - <p> - - When {@link PrefixBasedActionMapper#getMapping(HttpServletRequest, ConfigurationManager)} or - - {@link PrefixBasedActionMapper#getUriFromActionMapping(ActionMapping)} is invoked, - - {@link 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 - - {@link PrefixBasedActionMapper#getMapping(HttpServletRequest, ConfigurationManager)} and - - {@link PrefixBasedActionMapper#getUriFromActionMapping(ActionMapping)} methods. - - </p> - - - -</p> -{% comment %}end snippet id=description|javadoc=true|url=org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper {% endcomment %} +```xml +<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 `PrefixBasedActionMapper#getMapping(HttpServletRequest, ConfigurationManager)}` or `PrefixBasedActionMapper#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 `PrefixBasedActionMapper#getMapping(HttpServletRequest, ConfigurationManager)}` and +`PrefixBasedActionMapper#getUriFromActionMapping(ActionMapping)}` methods. -__PrefixBasedActionProxyFactory__ +### PrefixBasedActionProxyFactory -{% comment %}start snippet id=description|javadoc=true|url=org.apache.struts2.factory.PrefixBasedActionProxyFactory {% endcomment %} -<p> <p> - Prefix based factory should be used with {@link org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper} - to use appropriate {@link com.opensymphony.xwork2.ActionProxyFactory} connected with given - {@link org.apache.struts2.dispatcher.mapper.ActionMapper} - </p> +Prefix based factory should be used with `org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper` to use +appropriate {@link com.opensymphony.xwork2.ActionProxyFactory} connected with given `org.apache.struts2.dispatcher.mapper.ActionMapper`. - <p> - Add below entry to struts.xml to enable the factory: - </p> +Add below entry to `struts.xml` to enable the factory: - <pre> - <constant name="struts.actionProxyFactory" value="prefix"/> - </pre> +```xml +<constant name="struts.actionProxyFactory" value="prefix"/> +``` - <p> - The factory will use the same set of patterns as defined with: - </p> +The factory will use the same set of patterns as defined with: - <pre> +```xml <constant name="struts.mapper.prefixMapping" value="..."/> - </pre> -</p> -{% comment %}end snippet id=description|javadoc=true|url=org.apache.struts2.factory.PrefixBasedActionProxyFactory {% endcomment %} +``` ## ActionMapper and ActionMapping objects -- To stop receiving notification emails like this one, please contact "commits@struts.apache.org" <commits@struts.apache.org>.