Struts form target blank only when success.


Web tier: servlets, JSP, Web frameworks: Struts form target blank only when success.

  1. Struts form target blank only when success. (1 messages)

    God morning comunity. I develop some simple script than verify three simple input fields. If the validate fails, add some messages to the request and are catched with a html:errors tag. The objective than i'm looking is, when the success forward action is called, to open the page result in a new page. But if the validate fails, to reload the page. I have this tag form: Sorteo: Boleto: Premio: -Seleccione un sorteo por favor- Asignar The actual behavior is, when i send the form, and the validate return fails. A new window (following the _blank) is opened and show the same input page with the properly message errors. The exist a form to force open the window only when the action return the success forward? I anex my struts-config.xml

    Threaded Messages (1)

  2. my solve[ Go to top ]

    I'm done, unless don't know if is the most clean solution. I'm structure the jsp like this: .... ... This load the page the first time. I dont use the bean tag, because i recive a error handling from the AppServer telling me that there is not any value to check. ..... ..... Content 1 ..... ..... .... .... Content 2 .... .... And whit a javascript i'm validate if the values are writed, and if is true i do = "_blank"; I use all the path to the form, because for some reason, the override all short names to the form name and alerts. So i only put the validate struts messages in the next window called (action succes or fail). Soo, when is a failure forward, and for my rule return to the same page, but is a new window, the logic tag show only the errors. My only trouble now, is that when the all the data is correct, open a new window and show the page, i can't reset the previus window values, to clean that form than the user leave (to see a clean form when the user close the opened window). Regards.