I have a form wherein i fill in the details and click on Save button.
I do the validation of one of the fields in my action class.
If my validation returns true i redirect it to another action class to save the form data into database.
If my validation fails i redirect it to the jsp page.
David Newton wrote:There's nothing "anti-Struts" about using the session; that's what the session is there for.
Why do you redirect to the form page on a validation error? If you forwarded there wouldn't be an issue.
I tried <result type="forward">, but i get an error saying "forward" is not recognised..
I also tried <result="dispatcher">, but i get an error message saying "The Requested resource is not available". Is it it that i can only dispatch it to a jsp and not an action?
Any help would be highly appreciated.
Here is the code:
I validate the form fields using AuthenticateCIDAction. If success, then i add the information to the db. So i forward it to my next action class CustomerAction.
I want the form data intact, so i cannot use "redirect " as my result type.
Hence i used "chain" result type.
I tried using chain result type. But getting an error saying "The requested resource (There is no Action mapped for namespace /customer and action name SaveCustomer.action.) is not available.
Is there a problem with the syntax? or am i missing something?