File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts validation redirection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts validation redirection" Watch "Struts validation redirection" New topic

Struts validation redirection

Dhan Raj

Joined: Jan 24, 2005
Posts: 12

I am validating a form.

When the form is redirected to itself upon validation failure(with validation error messages) does not redirected to the proper page it came from.

(1) Page before Validation : ../MyWeb/
(2) Page After Validation : ../MyWeb/

Due to this, the redirected page displays few editable fields as uneditable fields. (Because, when (2) is in the URL few fields are suppose to be Uneditable as per my requirement)

How do I fix this?
Thx in Advance!
Dhan Raj
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864

Your best bet in this case is to include a hidden field with the name featureMode in your page to make sure the parameter is carried through subsequent calls to the page.

You'd also want to add the property featurMode to your form bean. Make sure that for this particular page, you set the property value to "sign" Then add the following:

This way the parameter will be set properly when the page is redisplayed by errors in the validate() method.


Consultant, Sima Solutions
I agree. Here's the link:
subject: Struts validation redirection
jQuery in Action, 3rd edition