wood burning stoves 2.0*
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 dp4java@yahoo.com
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)
Don't get me started about those stupid light bulbs.
subject: Need step by step procedure to use Validation framework
Similar Threads
Can any one help me how can i connect oracle9i with odbc
Form Based Authentication using SSL/TLS in JBOSS
Building a class which initializes abject like String class?
Xerces-2 Parsing to DOM and default attributes question
When to use Validation Method and when to use Validation Framework