aspose file tools*
The moose likes JSP and the fly likes Best Way to Validate the JSP form by using Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Best Way to Validate the JSP form by using Java" Watch "Best Way to Validate the JSP form by using Java" New topic
Author

Best Way to Validate the JSP form by using Java

YuenLian Wu
Ranch Hand

Joined: Nov 16, 2005
Posts: 73
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

Joined: Feb 24, 2006
Posts: 6662
    
    5

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.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Jakarta Commons Validators is your best bet.
 
jQuery in Action, 2nd edition
 
subject: Best Way to Validate the JSP form by using Java