struts action forward to another action


Web tier: servlets, JSP, Web frameworks: struts action forward to another action

  1. struts action forward to another action (2 messages)

    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 advance
  2. 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 ....
  3. How about using 'redirect' for forward. forward name="info" path="/jsp/info.jsp" redirect="true"/> Thanks, Anil.