-
Junior Member
Problem while working with ClientSide Validations in Struts
why i am getting NullpointerException when i am trying to perform validation
on Client side .In projects I am using ValidatorForm .Can any one reply to this
-
Junior Member
Re: Problem while working with ClientSide Validations in Struts
First, extending ValidatorForm doesnt mean validations will be done at client. I order to make vaidations to be done at client side make sure include <html:script> tag in your jsp page.
You are extending Validator form, make sure to do the follwing steps:
Configuration aspects:
1. Include <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in> in struts-config.xml
2. Check whether "validate=true" is set in your associated <action> within struts-config-xml.
3. define associated fileds in validation.xml files with necessary attributes (depends,property)
Class extending ValidatorForm
1. Override validate method, with ActionErrors errors=super.validate(mapping,request) followed by your field checking specific to your business rules.
I am comfort with validatorForm with the above mentioned steps.
I can help you more if you can provide me with your code snippets.
Ganti.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules