Author: tmjee
Date: Sun Nov 5 07:51:17 2006
New Revision: 471448
URL: http://svn.apache.org/viewvc?view=rev&rev=471448
Log:
WW-1490 (Have a composite ActionMapper that decides which ActionMapper it
contains should be used)
- added snippet, so we could use some of the javadoc in confluence
-
Modified:
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/CompositeActionMapper.java
Modified:
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/CompositeActionMapper.java
URL:
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/CompositeActionMapper.java?view=diff&rev=471448&r1=471447&r2=471448
==============================================================================
---
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/CompositeActionMapper.java
(original)
+++
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/CompositeActionMapper.java
Sun Nov 5 07:51:17 2006
@@ -35,18 +35,22 @@
import com.opensymphony.xwork2.util.FileManager;
/**
+ * <!-- START SNIPPET: description -->
+ *
* A composite action mapper that is capable of delegating to a series of
[EMAIL PROTECTED] ActionMapper} if the former
* failed to obtained a valid [EMAIL PROTECTED] ActionMapping} or uri.
* <p/>
* It is configured through struts.properties.
* <p/>
* For example, with the following entries in struts.properties
+ * <p/>
* <pre>
*
struts.mapper.class=org.apache.struts2.dispatcher.mapper.CompositeActionMapper
*
struts.mapper.composite.1=org.apache.struts2.dispatcher.mapper.DefaultActionMapper
*
struts.mapper.composite.2=org.apache.struts2.dispatcher.mapper.RestfulActionMapper
*
struts.mapper.composite.3=org.apache.struts2.dispatcher.mapper.Restful2ActionMapper
* </pre>
+ * <p/>
* When [EMAIL PROTECTED] CompositeActionMapper#getMapping(HttpServletRequest,
ConfigurationManager)} or
* [EMAIL PROTECTED]
CompositeActionMapper#getUriFromActionMapping(ActionMapping)} is invoked,
* [EMAIL PROTECTED] CompositeActionMapper} would go through these [EMAIL
PROTECTED] ActionMapper}s in sequence
@@ -56,8 +60,21 @@
* in which case it will just return null for both
* [EMAIL PROTECTED] CompositeActionMapper#getMapping(HttpServletRequest,
ConfigurationManager)} and
* [EMAIL PROTECTED]
CompositeActionMapper#getUriFromActionMapping(ActionMapping)} methods.
+ * <p/>
*
+ * For example with the following in struts.properties :-
+ * <pre>
+ *
struts.mapper.class=org.apache.struts2.dispatcher.mapper.CompositeActionMapper
+ *
struts.mapper.composite.1=org.apache.struts2.dispatcher.mapper.DefaultActionMapper
+ * struts.mapper.composite.2=foo.bar.MyActionMapper
+ * struts.mapper.composite.3=foo.bar.MyAnotherActionMapper
+ * </pre>
* <p/>
+ * <code>CompositeActionMapper</code> will be configured with 3 ActionMapper,
namely
+ * "DefaultActionMapper", "MyActionMapper" and "MyAnotherActionMapper".
+ * <code>CompositeActionMapper</code> would consult each of them in order
described above.
+ *
+ * <!-- END SNIPPET: description -->
*
* @see ActionMapper
* @see ActionMapperFactory