Validate Form values using Java

T

teser3

I want to create a JSP Form page (first.jsp) on Tomcat 4.1.27 with a
form that has about 20 input entries where the form will validate all
20 fields and show validation errors on the same page as the original
form page (first.jsp). For example, if someone has a blank entry on
the Firstname field then it will show this message in red next to the
field: First Name is required.

If the data passes the validations it will populate an Oracle
database. Please advise any suggestions on how I should do this. I was
thinking of submitting the fields to a Controller servlet then use the
Enumeration class to get all field values where I would check for
blanks and valid email address. I assume if I use a bean and have a
getter and setter method for each field I would then have 40 methods
(20 setter and 20 getter methods) in the bean class.

I dont have Struts and need to know the best way to do this. Can
anyone give me ideas or examples of how do to this?
 
F

fireflyc

I want to create a JSP Form page (first.jsp) on Tomcat 4.1.27 with a
form that has about 20 input entries where the form will validate all
20 fields and show validation errors on the same page as the original
form page (first.jsp). For example, if someone has a blank entry on
the Firstname field then it will show this message in red next to the
field: First Name is required.

If the data passes the validations it will populate an Oracle
database. Please advise any suggestions on how I should do this. I was
thinking of submitting the fields to a Controller servlet then use the
Enumeration class to get all field values where I would check for
blanks and valid email address. I assume if I use a bean and have a
getter and setter method for each field I would then have 40 methods
(20 setter and 20 getter methods) in the bean class.

I dont have Struts and need to know the best way to do this. Can
anyone give me ideas or examples of how do to this?

maybe you need commons-validator.
you can get it from http://commons.apache.org/validator/
good luck.
 
T

teser3

maybe you need commons-validator.
you can get it fromhttp://commons.apache.org/validator/
good luck.- Hide quoted text -

- Show quoted text -

I cant download any software or add any software due to restrictions
where I am at so I was hoping to do this with JavaBeans. Please
advise.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top