There are two more reasons why the validator just stops to work.
1) The jar files get corrupted. Replace them and try again, the application might start working perfectly 2) There might have been an extra new line character in the Validation.xml file

Checking these two helped me solve my problem with Validator. Hope it works for you too.


From: Karthik Manimaran <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
To: Struts Users Mailing List <user@struts.apache.org>
Subject: Re: Validation Issue
Date: Sun, 29 Jan 2006 16:42:11 -0500

Hi,

I tried this. Using debug info I can see that the validate method is being
called. But no errors are being returned.

Thanks and regards,
Karthik.


On 1/29/06, Angelo zerr <[EMAIL PROTECTED]> wrote:
>
> Hi,
> Name of form into validation.xml is the path of your Action
> and not the name of your Action :
>
> <form name="/Control">
> <field property="strFirstName" depends="required">
>    <arg0 key="privacyPrefForm.strFirstName"/>
> </field>
> </form>
>
>
> Declare in your AplicationResources
> (see example into validator-rules.xml)
>
> errors.required={0} is required.
> privacyPrefForm.strFirstName=First name
>
> Regards
> Angelo
>
>
> 2006/1/29, Karthik Manimaran <[EMAIL PROTECTED]>:
> >
> > This is the form definition
> >   <form-bean name="privacyPrefForm" type="
> > com.bofa.ecomm.snf.web.privacy.PrivacyPreferencesBean">
> >   </form-bean>
> >
> > The JSP file is as follows:
> > <%@ page language="java" %>
> > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> > <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> > <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
> >
> > <html:form action = "Control.do?body=privacysecur_set_privacy_pref"
> > method="post">
> >
> > <logic:notPresent name="org.apache.struts.action.ERROR">
> > Errors Not Present
> > </logic:notPresent>
> >
> > <html:errors/>
> >    <html:text property="strFirstName" size="30" maxlength="30"
> > styleId="strFirstName"/>
> > </html:form>
> >
> >
> > On 1/29/06, Richard Yee <[EMAIL PROTECTED]> wrote:
> > >
> > > What is the form definition for privacyPrefForm? Where is the tag for
> > > your strFirstName field in your form?
> > >
> > > Are you using a debugger at all?
> > >
> > > -Richard
> > >
> > >
> > > Karthik Manimaran wrote:
> > > > Hi,
> > > >
> > > > I am using the validator framework for form validation. Validation
> > > doesnt
> > > > seem to happen and no error messages are displayed. However the form
> > is
> > > > getting pre-populated with the user input. Can anyone tell me what I
> > am
> > > > missing here?
> > > >
> > > > struts-config.xml
> > > > -------------------------
> > > >   <action path="/Control" type="
> com.bofa.ecomm.snf.web.global.Control"
> > > > name="privacyPrefForm" scope="request" validate="true">
> > > >    <forward name="success" path="/jsp/global/def.jsp"/>
> > > >    <forward name="failure" path="/jsp/global/selectstate.jsp"/>
> > > >   </action>
> > > > ...
> > > >  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
> > > >   <set-property property="pathnames" value="/WEB-INF/validator-
> > rules.xml
> > > ,
> > > > /WEB-INF/validation.xml"/>
> > > >  </plug-in>
> > > >
> > > > validation.xml
> > > > ---------------------
> > > > <?xml version="1.0" encoding="ISO-8859-1" ?>
> > > >
> > > > <!DOCTYPE form-validation PUBLIC
> > > >           "-//Apache Software Foundation//DTD Commons Validator
> Rules
> > > > Configuration 1.1.3//EN"
> > > >           "
> http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd
> > ">
> > > >
> > > > <form-validation>
> > > >     <formset>
> > > >         <form name="privacyPrefForm">
> > > >             <field property="strFirstName"
> > > >                 depends="required">
> > > >                 <arg0 key="errors.required"/>
> > > >             </field>
> > > >         </form>
> > > >     </formset>
> > > > </form-validation>
> > > >
> > > > JSP file:
> > > > -----------
> > > >
> > > > <%@ page language="java" %>
> > > > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> > > > <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> > > >
> > > > <html:form action = "Control.do?body=privacysecur_set_privacy_pref"
> > > > method="post">
> > > > <html:errors/>
> > > > ....
> > > >
> > > > </html:form>
> > > >
> > > > I am using the validator-rules.xml that comes with struts
> > distribution.
> > > >
> > > > Thanks and regards,
> > > > Karthik
> > > >
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
>
>

_________________________________________________________________
Shah Rukh fan? Know all about the Baadshah of Bollywood. On MSN Search http://server1.msn.co.in/profile/shahrukh.asp


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to