struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Griffith, Michael *" <Michael.Griff...@fda.hhs.gov>
Subject <s:action/> redirect does not work with Tiles.
Date Thu, 07 Aug 2008 19:42:25 GMT
Hello All, 

 

I cannot make <s:action/> result go to a new page.  Chaining the result
does work, but the response shows my entire tile set showing up in the
inside tile, which is not what I want either.

 

Here is my scenario:

 

I have a JSP that includes a struts action as such...  

 

]--- begin edit.jsp ---[

 

<s:action name="form" executeResult="true" flush="false"
ignoreContextParams="false"/>

 

]--- end edit.jsp ---[

 

This JSP is a tile, (using Tiles 2) and the action form maps to an
action like this:

...

<action name="form" class="....web.struts.action.ResponseForm">

 

            <result name="success" type="responseResult">

                <param name="exposedValue">document</param>

                <param
name="stylesheetLocation">/WEB-INF/xsl/question.xsl</param>

            </result>

            <result name="finish" type="redirect-action">

            <param name="actionName">list</param>

                <param name="namespace">/respond</param>

            </result>

             <!--

                   This works, where as redirect-action does not. 

             <result name="finish" type="chain">

                        <param name="actionName">list</param>

                        <param name="namespace">/respond</param>

             </result>

            -->

</action>

 

The form action renders an html fragment, using XML/XSL result type, but
it is nested inside of a tiled result.  The form basically is like a
questionnaire wizard that presents an ordered list of questions and
allows a user to answer them, moving forward and back in the sequence.
In my ResponseForm action class I look for a parameter passed via the
http post, and if the parameter is "Quit" or "Finish" I want to execute
my finish result, and redirect to the list where I started.  

 

ResponseForm.execute

...

 

} else if (method != null && (method.equalsIgnoreCase("Quit") ||

method.equalsIgnoreCase("Finish"))) {

 

return "finish";

}

...

 

This does not work - and it doesn't throw any exceptions.  If I try to
use the result type chain instead of redirect-action, I am directed back
to the list, but the entire action (including the outermost tiles) show
up in the body tile - so it's like the website shows an entire HTML
response in the body tile, which is not correct either.

 

Any insight as to how to overcome this would be much appreciated...

 

Best regards,

 

Michael Griffith

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message