Hello all,

I'm setting up Xwork for the first time, following the instructions here:
http://wiki.opensymphony.com/space/Xwork+Validation+Framework

I think I have all the files in the correct places, with the correct values:

* I have a validators.xml file in my class root directory.
* I have a FormAction-validation.xml file in the same directory as it's
classfile.
* I've added a <interceptor-ref name="validation"/> tag to my action in
xwork.xml.

The form I'm validating has just 1 field, a text input field named "foo". In
FormAction-validation.xml I have this:

<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0//EN"
        "http://www.opensymphony.com/xwork/xwork-validator-1.0.dtd";>
<validators>
    <field name="foo">
        <field-validator type="int">
            <param name="min">0</param>
            <param name="max">100</param>
            <message key="foo.range">Could not find foo.range!</message>
        </field-validator>
    </field>
</validators>

Now when I post that form I get the following exception:

java.lang.ClassCastException: java.lang.Integer
        at java.lang.String.compareTo(String.java:913)
        at
com.opensymphony.xwork.validator.validators.AbstractRangeValidator.validate(
AbstractRangeValidator.java:29)
        at
com.opensymphony.xwork.validator.ActionValidatorManager.validate(ActionValid
atorManager.java:69)
        at
com.opensymphony.xwork.validator.ActionValidatorManager.validate(ActionValid
atorManager.java:55)
        at
com.opensymphony.xwork.validator.ValidationInterceptor.before(ValidationInte
rceptor.java:36)
        at
com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterce
ptor.java:36)
        at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocatio
n.java:149)
        at
com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterce
ptor.java:37)
        at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocatio
n.java:149)
        at
com.opensymphony.xwork.interceptor.TimerInterceptor.intercept(TimerIntercept
or.java:66)
        at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocatio
n.java:149)
        at
com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterce
ptor.java:37)
        at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocatio
n.java:149)
        at
com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterce
ptor.java:37)
        at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocatio
n.java:149)
        at
com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:12
1)
        at
com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatc
her.java:165)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

Sounds like a configuration problem to me, but I'm not sure. Any help would
be much appreciated!

Bryan White
[EMAIL PROTECTED]





-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to