File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Problem with validator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with validator" Watch "Problem with validator" New topic

Problem with validator

Saji T.Sathian

Joined: Nov 27, 2008
Posts: 7
I have the following entry in struts-config.xml

<action path="/registration"

<forward name="success"


Problem is that if validation fails control is not forwarded to the value
of 'input' attribute of the action element.Insted I get a blank page

If validate attribute is set to 'false' everything works fine.

But that does not help validation.

If you have solved problems of this kind please help
Saji T.Sathian

Joined: Nov 27, 2008
Posts: 7
One thing I forgot to mention is that of Form Bean.

<form-bean name="userRegistrationForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="userID" type="java.lang.String"></form-property>
<form-property name="password" type="java.lang.String"></form-property>
<form-property name="confirmationPassword" type="java.lang.String"></form-property>
<form-property name="email" type="java.lang.String"></form-property>
<form-property name="bloodGroup" type="java.lang.String"></form-property>
<form-property name="name" type="java.lang.String"></form-property>
<form-property name="gender" type="java.lang.String"></form-property>
<form-property name="dateOfBirth" type="java.lang.String"></form-property>
<form-property name="address" type="java.lang.String"></form-property>
<form-property name="district" type="java.lang.String"></form-property>
<form-property name="state" type="java.lang.String"></form-property>
<form-property name="country" type="java.lang.String"></form-property>
<form-property name="phone" type="java.lang.String"></form-property>
<form-property name="mobileNO" type="java.lang.String"></form-property>


Please note type of form bean is



Saji T Sathian
David Newton

Joined: Sep 29, 2008
Posts: 12617

I'd guess there's an error in the validation config/code or in the JSP. Is there anything in the log?
Saji T.Sathian

Joined: Nov 27, 2008
Posts: 7
Thank you very much for reading my post.

The configuration is as follows


<form name="userRegistrationForm">
<field property="userID" depends="required,mask">
<msg name="mask" key="userRegistration.userID.maskmsg"></msg>
<arg0 key="userRegistration.userID.displayname"></arg0>

The JSP works fine when 'validate' attribute of action element is set to 'false'

Nothing is available with logs.

Saji T Sathian
Saji T.Sathian

Joined: Nov 27, 2008
Posts: 7
I failed to resolve the problem yet.I have found some more problems with client side validation. validateMinlength() is notworking with password
fields. validateDate() is also have problems.You have to edit these two
functions for getting correct output.

Saji T Sathian
Saji T.Sathian

Joined: Nov 27, 2008
Posts: 7
Everything I mentioned was only applicable to struts 1.1
I agree. Here's the link:
subject: Problem with validator
It's not a secret anymore!