-
struts action forward to another action (2 messages)
- Posted by: e gm
- Posted on: January 18 2008 19:12 EST
Hi, this is my problem; I've an application developed with struts and tiles, and I've the next problem. Adding a customer with the following secuence: -click New Customer button -action that forwards to a jsp with the empty form -fill the form, click Save, other action inserts the customer and forward to an info.jsp that shows the Ok message Now if you reload the page it wants to insert another customer (thanks to validate() it can't ) To solve this ugly situation, we are trying to call to another action before forwarding to info.jsp, then the reload will execute the foo second action thah only forwards to the info.jsp. But I can't do that trivial thing at the struts-config.xml, I want to make the forward of the action-mapping redirects to another action. Anybody could say something to me? Ah, we use tiles too Thanks in advanceThreaded Messages (2)
- Re: struts action forward to another action by Carlos Rodriguez Fernandez on January 22 2008 16:42 EST
- Re: struts action forward to another action by Anil Kumar Sadineni on January 28 2008 12:44 EST
-
Re: struts action forward to another action[ Go to top ]
- Posted by: Carlos Rodriguez Fernandez
- Posted on: January 22 2008 16:42 EST
- in response to e gm
Which version of struts do you use? I'm not sure if I've understood you problem but I would change the pages flow. Page-->PrepareFormAction-->Form.jsp Form.jsp-->SaveDataAction-->PrepareFormAction-->Form.jsp (cycle until "Finish Adding" button being clicked). In struts 2.0 it is easy to solve: Form.jsp ... PrepareFormAction .... -
Re: struts action forward to another action[ Go to top ]
- Posted by: Anil Kumar Sadineni
- Posted on: January 28 2008 12:44 EST
- in response to e gm
How about using 'redirect' for forward. forward name="info" path="/jsp/info.jsp" redirect="true"/> Thanks, Anil.