Author: tchemit Date: 2012-05-02 13:28:51 +0200 (Wed, 02 May 2012) New Revision: 3350 Url: http://chorem.org/repositories/revision/pollen/3350 Log: optimize dependencies + fix javadoc Modified: trunk/pollen-ui-struts2/pom.xml trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/results/PollenServletActionRedirectResult.java Modified: trunk/pollen-ui-struts2/pom.xml =================================================================== --- trunk/pollen-ui-struts2/pom.xml 2012-05-02 11:16:10 UTC (rev 3349) +++ trunk/pollen-ui-struts2/pom.xml 2012-05-02 11:28:51 UTC (rev 3350) @@ -178,6 +178,7 @@ <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> + <scope>runtime</scope> </dependency> </dependencies> Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/results/PollenServletActionRedirectResult.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/results/PollenServletActionRedirectResult.java 2012-05-02 11:16:10 UTC (rev 3349) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/results/PollenServletActionRedirectResult.java 2012-05-02 11:28:51 UTC (rev 3350) @@ -52,7 +52,6 @@ import org.apache.struts2.ServletActionContext; import org.apache.struts2.dispatcher.Dispatcher; import org.apache.struts2.dispatcher.ServletActionRedirectResult; -import org.apache.struts2.dispatcher.ServletRedirectResult; import org.apache.struts2.dispatcher.mapper.ActionMapper; import org.apache.struts2.dispatcher.mapper.ActionMapping; import org.apache.struts2.views.util.UrlHelper; @@ -62,99 +61,8 @@ import java.util.Map; /** - * <!-- START SNIPPET: description --> - * <p/> - * This result uses the {@link ActionMapper} provided by the - * {@link ActionMapperFactory} to redirect the browser to a URL that invokes the - * specified action and (optional) namespace. This is better than the - * {@link ServletRedirectResult} because it does not require you to encode the - * URL patterns processed by the {@link ActionMapper} in to your struts.xml - * configuration files. This means you can change your URL patterns at any point - * 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. - * <p/> - * See examples below for an example of how request parameters could be passed - * in. - * <p/> - * <!-- END SNIPPET: description --> - * <p/> - * <b>This result type takes the following parameters:</b> - * <p/> - * <!-- START SNIPPET: params --> - * <p/> - * <ul> - * <p/> - * <li><b>actionName (default)</b> - The name of the action that will be - * redirected to.</li> - * <p/> - * <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> - * <p/> - * <li><b>suppressEmptyParameters</b> - Optional boolean (defaults to false) that - * can prevent parameters with no values from being included in the redirect - * URL.</li> - * <p/> - * <li><b>parse</b> - Boolean, true by default. If set to false, the actionName - * param will not be parsed for Ognl expressions.</li> - * <p/> - * <li><b>anchor</b> - Optional. Also known as "fragment" or colloquially as - * "hash". You can specify an anchor for a result.</li> - * </ul> - * <p/> - * <!-- END SNIPPET: params --> - * <p/> - * <b>Example:</b> - * <p/> - * <pre> - * <!-- START SNIPPET: example --> - * <package name="public" extends="struts-default"> - * <action name="login" class="..."> - * <!-- Redirect to another namespace --> - * <result type="redirectAction"> - * <param name="actionName">dashboard</param> - * <param name="namespace">/secure</param> - * </result> - * </action> - * </package> + * Fork of the {@link ServletActionRedirectResult} to be able to use : in urls. * - * <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) --> - * <!-- - * The redirectAction url generated will be : - * /genReport/generateReport.action?reportType=pie&width=100&height=100#summary - * --> - * <action name="gatherReportInfo" class="..."> - * <result name="showReportResult" type="redirectAction"> - * <param name="actionName">generateReport</param> - * <param name="namespace">/genReport</param> - * <param name="reportType">pie</param> - * <param name="width">100</param> - * <param name="height">100</param> - * <param name="empty"></param> - * <param name="suppressEmptyParameters">true</param> - * <param name="anchor">summary</param> - * </result> - * </action> - * </package> - * - * - * <!-- END SNIPPET: example --> - * </pre> - * * @see ActionMapper */ public class PollenServletActionRedirectResult extends ServletActionRedirectResult { @@ -162,7 +70,7 @@ private static final long serialVersionUID = -9042425229314584066L; private static final Logger LOG = - LoggerFactory.getLogger(ServletRedirectResult.class); + LoggerFactory.getLogger(PollenServletActionRedirectResult.class); /** * Redirects to the location specified by calling @@ -172,6 +80,7 @@ * @param invocation an encapsulation of the action execution state. * @throws Exception if an error occurs when redirecting. */ + @Override protected void doExecute(String finalLocation, ActionInvocation invocation) throws Exception { ActionContext ctx = invocation.getInvocationContext(); HttpServletRequest request = (HttpServletRequest) ctx.get(ServletActionContext.HTTP_REQUEST);