You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by mc...@apache.org on 2011/10/26 01:14:09 UTC

svn commit: r1188963 - in /struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher: ServletActionRedirectResult.java ServletRedirectResult.java

Author: mcucchiara
Date: Tue Oct 25 23:14:09 2011
New Revision: 1188963

URL: http://svn.apache.org/viewvc?rev=1188963&view=rev
Log:
WW-3652 - Add example for "anchor" (aka "hash" or "fragment") to RedirectActionResult docs (patch submitted by Jeff Black)

Modified:
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletActionRedirectResult.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletActionRedirectResult.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletActionRedirectResult.java?rev=1188963&r1=1188962&r2=1188963&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletActionRedirectResult.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletActionRedirectResult.java Tue Oct 25 23:14:09 2011
@@ -56,17 +56,22 @@ import com.opensymphony.xwork2.util.refl
  * 
  * <ul>
  * 
- * <li><b>actionName (default)</b> - the name of the action that will be
- * redirect to</li>
+ * <li><b>actionName (default)</b> - The name of the action that will be
+ * redirected to.</li>
  * 
- * <li><b>namespace</b> - used to determine which namespace the action is in
- * that we're redirecting to . If namespace is null, this defaults to the
- * current namespace</li>
+ * <li><b>namespace</b> - Used to determine which namespace the action is in
+ * that we're redirecting to.  If namespace is null, the default will be the
+ * current namespace.</li>
  * 
- * <li><b>suppressEmptyParameters</b> - optional boolean (defaults to false) that
+ * <li><b>suppressEmptyParameters</b> - Optional boolean (defaults to false) that
  * can prevent parameters with no values from being included in the redirect
  * URL.</li>
- * 
+ *
+ * <li><b>parse</b> - Boolean, true by default.  If set to false, the actionName 
+ * param will not be parsed for Ognl expressions.</li>
+ *
+ * <li><b>anchor</b> - Optional.  Also known as "fragment" or colloquially as 
+ * "hash".  You can specify an anchor for a result.</li>
  * </ul>
  * 
  * <!-- END SNIPPET: params -->
@@ -98,10 +103,10 @@ import com.opensymphony.xwork2.util.refl
  * &lt;/package&gt;
  * 
  * &lt;package name="passingRequestParameters" extends="struts-default" namespace="/passingRequestParameters"&gt;
- *    &lt;-- Pass parameters (reportType, width and height) --&gt;
+ *    &lt;!-- Pass parameters (reportType, width and height) --&gt;
  *    &lt;!--
  *    The redirectAction url generated will be :
- *    /genReport/generateReport.action?reportType=pie&width=100&height=100
+ *    /genReport/generateReport.action?reportType=pie&width=100&height=100#summary
  *    --&gt;
  *    &lt;action name="gatherReportInfo" class="..."&gt;
  *       &lt;result name="showReportResult" type="redirectAction"&gt;
@@ -112,6 +117,7 @@ import com.opensymphony.xwork2.util.refl
  *          &lt;param name="height"&gt;100&lt;/param&gt;
  *          &lt;param name="empty"&gt;&lt;/param&gt;
  *          &lt;param name="suppressEmptyParameters"&gt;true&lt;/param&gt;
+ *          &lt;param name="anchor"&gt;summary&lt;/param&gt;
  *       &lt;/result&gt;
  *    &lt;/action&gt;
  * &lt;/package&gt;

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java?rev=1188963&r1=1188962&r2=1188963&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java Tue Oct 25 23:14:09 2011
@@ -72,8 +72,8 @@ import com.opensymphony.xwork2.util.refl
  * <li><b>parse</b> - true by default. If set to false, the location param will
  * not be parsed for Ognl expressions.</li>
  * 
- * <li><b>anchor</b> - optional, you can specify an anchor for result.</li>
- * 
+ * <li><b>anchor</b> - Optional.  Also known as "fragment" or colloquially as 
+ * "hash".  You can specify an anchor for a result.</li>
  * </ul>
  * 
  * <p>
@@ -86,6 +86,10 @@ import com.opensymphony.xwork2.util.refl
  * 
  * <pre>
  * <!-- START SNIPPET: example -->
+ * &lt;!--
+ *   The redirect URL generated will be:
+ *   /foo.jsp#FRAGMENT
+ * --&gt;
  * &lt;result name="success" type="redirect"&gt;
  *   &lt;param name="location"&gt;foo.jsp&lt;/param&gt;
  *   &lt;param name="parse"&gt;false&lt;/param&gt;