struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Caswell" <scasw...@allconnect.com>
Subject FW: Validator not working
Date Mon, 28 Jul 2003 12:54:01 GMT
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:gabriel@maisis.pt]
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: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message