This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts validation redirection" Watch "Struts validation redirection" New topic
Author

Struts validation redirection

Dhan Raj
Greenhorn

Joined: Jan 24, 2005
Posts: 12
Hi

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.

Eg:
(1) Page before Validation : ../MyWeb/CapDisplay.do?featureMode=sign
(2) Page After Validation : ../MyWeb/CapDisplay.do

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
Dhan,

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.

Merrill


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts validation redirection
 
Similar Threads
Stopping the struts validation for a particular non-displayed fields
Form Validation and Delete using struts
Displaying error in multi page form.
Browser Back button handling wusing spring
DynaValidatorForm not redisplaying scoped variables