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 * </package> * * <package name="passingRequestParameters" extends="struts-default" namespace="/passingRequestParameters"> - * <-- Pass parameters (reportType, width and height) --> + * <!-- Pass parameters (reportType, width and height) --> * <!-- * 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 * --> * <action name="gatherReportInfo" class="..."> * <result name="showReportResult" type="redirectAction"> @@ -112,6 +117,7 @@ import com.opensymphony.xwork2.util.refl * <param name="height">100</param> * <param name="empty"></param> * <param name="suppressEmptyParameters">true</param> + * <param name="anchor">summary</param> * </result> * </action> * </package> 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 --> + * <!-- + * The redirect URL generated will be: + * /foo.jsp#FRAGMENT + * --> * <result name="success" type="redirect"> * <param name="location">foo.jsp</param> * <param name="parse">false</param>