This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes How to use struts validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to use struts validation" Watch "How to use struts validation" New topic

How to use struts validation

sivakumar panchu

Joined: Jul 18, 2007
Posts: 20
I am new to struts please help me.

My project flow like this :

The request goes to class then it forward to Customer.jsp .

i get the information from the user using Customer.jsp i want to validate the users data is it possible?

how can i use struts validation for this ?
Amit Sharma

Joined: Oct 29, 2007
Posts: 4
Hi sivakumar,

I would firstly, suggest you reading some online struts tutorial.

But, just to provide to with some insight; struts has a validation framework which gives to options of having two types of Validation:-
1. Client Side validation
this can be done by using Validation Framework configuration using validation XML configuration file. This help in generating Client Side Java Script validation Code. This is good in most of common scenarios. But if you have a complex validation then i would suggest using the second option.

2. Server Side Validation
this can be by extending ValidatorForm instead of Simple Action Form. you have implement Validate method in your form class also you have validation done in your action class.

sivakumar panchu

Joined: Jul 18, 2007
Posts: 20
Thanks Sharma
I agree. Here's the link:
subject: How to use struts validation
Similar Threads
Struts2 + Validation + issue..
Error Processing with Struts in WSAD
How to do the Date validation in .xml
Struts validation help needed....
How to index the JSP page for different pages