struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Prashant Samant" <Prashant.Sam...@mphasis.com>
Subject Valid when problem
Date Fri, 18 Jul 2003 04:42:58 GMT
Hello Group,
Yesterday i had posted a question regarding the use of "validWhen" attribute for the depends
clause in the Struts validator framework.
The general response was, it will be included in struts 1.2.
But now i have a doubt.
yesterday i changed my validtion.xml to

<validator name="validwhen"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateMinLength"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionErrors,
                       javax.servlet.http.HttpServletRequest"
              
         msg="errors.minlength">
       </validator>

And its working fine.
But the error message which i am getting on the jsp page is "Payment method can not be less
than null characters
".

But when i change the validation.xml to 

<validator name="validwhen"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateValidWhen"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionErrors,
                       javax.servlet.http.HttpServletRequest"
              
                  msg="errors.required">
       </validator>

it gives me an exception

[ERROR] Validator - -reflection: null <java.lang.NoSuchMethodException>java.lang
.NoSuchMethodException
        at java.lang.Class.getMethod0(Native Method)
        at java.lang.Class.getMethod(Class.java:888)
        at org.apache.commons.validator.Validator.validateFieldForRule(Validator
.java:401)
        at org.apache.commons.validator.Validator.validateField(Validator.java:5
44)
        at org.apache.commons.validator.Validator.validate(Validator.java:582)
        at org.apache.struts.validator.DynaValidatorForm.validate(DynaValidatorF
orm.java:151)
        at org.apache.struts.action.RequestProcessor.processValidate(RequestProc
essor.java:942)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:255)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
2)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:263)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
        at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2390)
        at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:1959)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


pls advise,
Prashant S.


---------------------------------------------------------------------
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