aspose file tools*
The moose likes Struts and the fly likes Where to Struts controller redirects if a form validation fails? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Where to Struts controller redirects if a form validation fails?" Watch "Where to Struts controller redirects if a form validation fails?" New topic
Author

Where to Struts controller redirects if a form validation fails?

Umar Mughal
Greenhorn

Joined: Feb 01, 2010
Posts: 1
Hi everyone

This is my first post at CodeRanch. Previously I had been using stackoverflow.com and it was very good, but some of the times I couldn't find the answers to very critical questions. The question I am asking here is one such question, unanswered there, now I am trying my luck here . Please give me a few minutes if you know about it.

So my question is:

Where to Struts controller redirects if a form validation fails? Does it redirect to the value in input attribute in the action element of struts-config file? How can we set the flag redirect="true" for the forward when validation fails? ( So that the url of page being redirected to, is shown in the browser instead of html:form action url. )

Or let me put this in this way:

How can we make sure that, if a form validation fails, we do not see the html:form action url in the browser, but the url of the page being redirected to?

Thank you very much for your time.

Umar
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Where to Struts controller redirects if a form validation fails?