Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Best Way to Validate the JSP form by using Java

 
YuenLian Wu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear geeks,

I have some design questions regarding to the web form. My form has a lot of fields like Customer Name 1, Customer Password 1, Confirm Customer Password 1. I call those as a group. I have around 20 groups of that on my web form because of the user requirement. I feel so annoying that if I have to use the following validation code for each group,



The above code is good for few groups, however, I have a lot of such groups and I need to validate one by one. I feel so boring if I just copy paste one set of code and pase it to the jsp and rename the variable names.

ANy better way to implement that ? Myriad thanks

Transistor
[ April 26, 2006: Message edited by: YuenLian Wu ]
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you heard of the Struts framework ? Your values will automatically be mapped to variable names in classes. Do look into some example applications that use this.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jakarta Commons Validators is your best bet.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic