• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Password and Email server-side validation

 
Nina Anderson
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I'm trying to switch from client-side to Server-side validation. However, I don't know how I can validate "password" and "email" fields on the server-side.

Please help me on how I can change the following to Server-side:

 
Gary Dhaliwal
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can leave your validation.xml as is (Make sure you have a <form name=?> tag around your fields).

Now instead of subclassing your form beans from ActionForm subclass from ValidatorForm

ie. Change public class CompanySearchForm extends ActionForm{
to public class CompanySearchForm extends ValidatorForm{

And lastly make sure your action tag in struts-config.xml has validate="true"

i.e. <action path="/createJob" validate="true" ...
[ October 19, 2008: Message edited by: G Dddd ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"G Dddd", please check your private messages for an important administrative matter.
 
Gary Dhaliwal
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok.
 
Nina Anderson
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response. This was helpful.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic