Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Problem with validator

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
Everything I mentioned was only applicable to struts 1.1
 
Switching from electric heat to a rocket mass heater reduces your carbon footprint as much as parking 7 cars. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic