This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes Need step by step procedure to use Validation framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Need step by step procedure to use Validation framework" Watch "Need step by step procedure to use Validation framework" New topic

Need step by step procedure to use Validation framework

Prasad Babu
Ranch Hand

Joined: Jul 17, 2005
Posts: 57
Hi All,
I am getting manual validation i.e. i am writing the validation code in ActionForm class. But I know this is not a good approach. I would like to use comple Validation frame work for the Form validation either serverside or client side. do anybody explain the step by step procedure to use validation framework(struts). I already searched in the internet for the tutorials but i could not find the right one. I also read a couple of books. but i did not get the result. I am understanding the concept. but i can not implement. I tried so many times to implement but not getting.
If you explain with example application, it would be appreciated. or you please can send any .war application which is implemented with validation to
thanks in advance
sureshreddy puli

Joined: Sep 28, 2005
Posts: 29
Step1: Configure your struts-config.xml as shown bellow.

<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"

Step2: Edit validation.xml as shown bellow.

<form name="XXXXX">
<field property="firstName" depends="required" >
<arg0 key="your key" resourse="false"/>

give your form name instead of XXXXX. Eg.loginForm (given in form-bean name)

Step3:Your Form Bean class must extends ValidatorForm class.

------------------------->Server side validations

Step4:You must include the following.

<html:javascript formName="XXXXX" />
<html:form action="..." onsubmit="return validateXXXXX(this)"
------------------------->Javascript validations(Client side)
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Need step by step procedure to use Validation framework
It's not a secret anymore!