• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Problem with validator

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the following entry in struts-config.xml

<action path="/registration"
type="com.search.bb.account.struts.UserRegistrationAction"
name="userRegistrationForm"
input="site.page.registration"
validate="true">

<forward name="success"
path="site.page.registrationSuccess">
</forward>

</action>

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
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One thing I forgot to mention is that of Form Bean.

<form-bean name="userRegistrationForm" type="org.apache.struts.validator.DynaValidatorForm">
<display-name>userRegistrationForm</display-name>
<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>

</form-bean>

Please note type of form bean is

org.apache.struts.validator.DynaValidatorForm

Regards,

Saji T Sathian
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much for reading my post.

The configuration is as follows

<form-validation>
<global>

</global>
<formset>
<form name="userRegistrationForm">
<field property="userID" depends="required,mask">
<msg name="mask" key="userRegistration.userID.maskmsg"></msg>
<arg0 key="userRegistration.userID.displayname"></arg0>
<var>
<var-name>mask</var-name>
<var-value>^[a-zA-Z0-9]*$</var-value></var></field></form></formset>
</form-validation>

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

Nothing is available with logs.

Regards,
Saji T Sathian
 
Saji T.Sathian
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Regards,
Saji T Sathian
 
Saji T.Sathian
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Everything I mentioned was only applicable to struts 1.1
 
This is my favorite show. And this is my favorite tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic