File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts2 hidden fields empty after validation

 
kuha guna
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i have some hidden fields in in my form after server side struts validation these fields are emptied. what is the possible workaround to handle this problem.

Thanks in advance
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

First understand when you validate your form and validation called then the flow of your project not reached at your action calss.

So all the variable which is use in jsp initialize again when your validation fail.

so, when you validate every time your validate methid call.

so Override validate methd in your Action class and initialize your hidden varibale in validate methid. Like.

@Override
public void validate() {
hiddenvaribale=value;
}

all variable which you want to get back when validation failed you have to again initialize at validate method.


If you have still any problem post your jsp code and action code.




 
kuha guna
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Nishan.
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

Your welcome.

But is it working fine ??


 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic