Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts validation redirection

 
Dhan Raj
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic