Commits

tschneider22  committed ae26ee1

Modified renderer so that redirect action results work

Issue number: WW-1378
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@2829573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits 609aa9a

Comments (0)

Files changed (3)

File src/java/com/opensymphony/webwork/sitegraph/renderers/DOTRenderer.java

 
                     } else if (resultClassName.indexOf("Redirect") != -1) {
                         // check if the redirect is to an action -- if so, link it
-                        String location = getViewLocation((String) resultConfig.getParams().get("location"), namespace);
+                        String locationConfig = (String) resultConfig.getParams().get("location");
+                        if (locationConfig == null) {
+                            locationConfig = (String) resultConfig.getParams().get("actionName");
+                        }
+                        String location = getViewLocation(locationConfig, namespace);
                         if (location.endsWith((String) Configuration.get(WebWorkConstants.WEBWORK_ACTION_EXTENSION))) {
                             addTempLink(action, location, Link.TYPE_REDIRECT, resultConfig.getName());
                         } else {

File src/test/com/opensymphony/webwork/sitegraph/out.txt

     tutorial_sitegraph_guess_success_jsp -> tutorial_sitegraph_guess [label="href\n(!default)"];
     hello -> hello_jsp [label="success",color="darkseagreen2"];
     hello -> tutorial_test [label="redirect: tutorial"];
+    hello -> tutorial_test [label="redirect: tutorial2"];
     tutorial_test -> tutorial_sitegraph_guess_input_ftl [label="input",color="darkseagreen2"];
 }

File src/test/com/opensymphony/webwork/sitegraph/xwork.xml

         <action name="hello" class="com.opensymphony.xwork.ActionSupport">
             <result name="success">hello.jsp</result>
             <result name="tutorial" type="redirect">/tutorial/test.action</result>
+            <result name="tutorial2" type="redirect-action">/tutorial/test.action</result>
         </action>
     </package>