The validator does logging, but it is mostly at the debug level, which is typically 
turned off by default. You have to configure a logger to turn on debug level logging 
to see the validator's log messages. Otherwise the validator will operate (and in some 
cases hide errors) silently.

-----Original Message-----
From: Gabriel Guerreiro [mailto:[EMAIL PROTECTED]
Sent: Monday, July 28, 2003 12:58 PM
To: Steve Caswell
Subject: Re: Validator not working


Thanks for your advice.

Logging is a subject I didnīt care much about.
In Struts 1.0 I used only servlet.log(...).

I gess the validator is simply not logging anything.
(are there some messages that should appear in any case? I am checking 
catalina.out)

It seems to be a validator problem.
All the input the validator needs seems to be in place.
I will try a custom validation method next.

Steve Caswell wrote:

>The Struts Validator plug-in delegates to Commons Validator for the real work. 
>Commons Validator uses Commons Logging for logging. You can enable logging by 
>configuring one of the loggers supported by Commons Logging. I use Log4J. Here is my 
>log4j.properties files in WEB-INF/classes:
>
>log4j.appender.CONSOLE_APPENDER=org.apache.log4j.ConsoleAppender
>log4j.appender.CONSOLE_APPENDER.layout=org.apache.log4j.PatternLayout
>log4j.appender.CONSOLE_APPENDER.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %p - 
>%m%n
>
>log4j.category.org.apache.commons.beanutils=DEBUG, CONSOLE_APPENDER
>log4j.category.org.apache.commons.digester.Digester=DEBUG, CONSOLE_APPENDER
>log4j.category.org.apache.commons.digester.Digester.sax=DEBUG, CONSOLE_APPENDER
>log4j.category.org.apache.commons.validator=DEBUG, CONSOLE_APPENDER
>log4j.category.org.apache.struts=DEBUG, CONSOLE_APPENDER
>
>If you use something other than Log4J, you'll need to configure it to log the 
>org.apache.commons.validator hierarchy.
>
>-----Original Message-----
>From: Gabriel Guerreiro [mailto:[EMAIL PROTECTED]
>Sent: Monday, July 28, 2003 8:12 AM
>To: Struts Users Mailing List
>Subject: Validator not working
>
>
>Hi,
>
>I am integrating struts-validator in a struts-based application.
>Validadion does not return errors in the server-side validation.
>
>Whith this simple test form:
>
>    <form name="ProfileForm">
>        <field property="profileNum"
>                depends="required,integer,intRange">
>        <arg0 key="Number" resource="false"/>
>        <arg1 name="intRange" key="${var:min}" resource="false"/>
>        <arg2 name="intRange" key="${var:max}" resource="false"/>
>        <var>
>            <var-name>min</var-name>
>            <var-value>0</var-value>
>        </var>
>        <var>
>            <var-name>max</var-name>
>            <var-value>999</var-value>
>        </var>
>        </field>
>        <field property="name"
>                depends="required">
>        <arg0 key="Name" resource="false"/>
>        </field>
>    </form>
>
>and the same validation-rules.xml as the one in struts-validator.war,
>the super.validate() returns an empty ActionErrors.
>
>Other custom validations on the form work.
>The javascript validation based on the same rules works.
>
>I am using Struts 1.1 and tomcat 4.0.6.
>
>I canīt find any error messages in the tomcat logs.
>Is there a custom setting for validator logs?
>
>This is the ActionMapping:
>
>    <action path="/ProfileActions"
>        className="pt.mai.ngin.ags.common.struts.NginActionMapping"
>        type="pt.mai.ngin.ags.common.struts.NginActions"
>        name="ProfileForm"
>        scope="session"
>        parameter="method"
>        validate="true"
>        input="/ProfilesForm.jsp">
>        <forward redirect="true"   name="success"         
>path="/ProfilesView.jsp"/>
>    </action>
>
>I have no clue what to check next. :-(
>
>Gabriel
>
>
>  
>



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

Reply via email to