Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Struts Password and Email server-side validation

 
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:

 
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 ]
 
Marshal
Posts: 67280
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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.
 
See where your hand is? Not there. It's next to this tiny ad:
Enterprise-grade Excel API for Java
https://products.aspose.com/cells/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!