You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by da...@apache.org on 2008/11/30 17:04:46 UTC
svn commit: r721838 -
/struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletActionRedirectResult.java
Author: davenewton
Date: Sun Nov 30 08:04:46 2008
New Revision: 721838
URL: http://svn.apache.org/viewvc?rev=721838&view=rev
Log:
Fix for WW-2889 Use StringBuilder instead of StringBuffer; UrlHelper:r720222 change.
Modified:
struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletActionRedirectResult.java
Modified: struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletActionRedirectResult.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletActionRedirectResult.java?rev=721838&r1=721837&r2=721838&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletActionRedirectResult.java (original)
+++ struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletActionRedirectResult.java Sun Nov 30 08:04:46 2008
@@ -44,11 +44,11 @@
import com.opensymphony.xwork2.inject.Inject;
/**
- *
+ *
* Portlet modification of the {@link ServletActionRedirectResult}.
- *
+ *
* <!-- START SNIPPET: description -->
- *
+ *
* This result uses the {@link ActionMapper} provided by the
* {@link ActionMapperFactory} to instruct the render phase to invoke the
* specified action and (optional) namespace. This is better than the
@@ -58,31 +58,31 @@
* and your application will still work. It is strongly recommended that if you
* are redirecting to another action, you use this result rather than the
* standard redirect result.
- *
+ *
* See examples below for an example of how request parameters could be passed
* in.
- *
+ *
* <!-- END SNIPPET: description -->
- *
+ *
* <b>This result type takes the following parameters:</b>
- *
+ *
* <!-- START SNIPPET: params -->
- *
+ *
* <ul>
- *
+ *
* <li><b>actionName (default)</b> - the name of the action that will be
* redirect 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>
- *
+ *
* </ul>
- *
+ *
* <!-- END SNIPPET: params -->
- *
+ *
* <b>Example:</b>
- *
+ *
* <pre>
* <!-- START SNIPPET: example -->
* <package name="public" extends="struts-default">
@@ -94,19 +94,19 @@
* </result>
* </action>
* </package>
- *
+ *
* <package name="secure" extends="struts-default" namespace="/secure">
* <-- Redirect to an action in the same namespace -->
* <action name="dashboard" class="...">
* <result>dashboard.jsp</result>
* <result name="error" type="redirectAction">error</result>
* </action>
- *
+ *
* <action name="error" class="...">
* <result>error.jsp</result>
* </action>
* </package>
- *
+ *
* <package name="passingRequestParameters" extends="struts-default" namespace="/passingRequestParameters">
* <-- Pass parameters (reportType, width and height) -->
* <!--
@@ -123,11 +123,11 @@
* </result>
* </action>
* </package>
- *
- *
+ *
+ *
* <!-- END SNIPPET: example -->
* </pre>
- *
+ *
* @see ActionMapper
*/
public class PortletActionRedirectResult extends PortletResult implements ReflectionExceptionHandler {
@@ -210,8 +210,8 @@
}
}
- StringBuffer tmpLocation = new StringBuffer(actionMapper.getUriFromActionMapping(new ActionMapping(actionName,
- namespace, method, null)));
+ StringBuilder tmpLocation = new StringBuilder(actionMapper.getUriFromActionMapping(new ActionMapping(actionName,
+ namespace, method, null)));
UrlHelper.buildParametersString(requestParameters, tmpLocation, "&");
setLocation(tmpLocation.toString());
@@ -221,7 +221,7 @@
/**
* Sets the action name
- *
+ *
* @param actionName
* The name
*/
@@ -231,7 +231,7 @@
/**
* Sets the namespace
- *
+ *
* @param namespace
* The namespace
*/
@@ -241,7 +241,7 @@
/**
* Sets the method
- *
+ *
* @param method
* The method
*/
@@ -251,7 +251,7 @@
/**
* Adds a request parameter to be added to the redirect url
- *
+ *
* @param key
* The parameter name
* @param value