You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Holger Moosbauer <hm...@tecon.de> on 2006/01/02 14:02:23 UTC

Strange validation exception

Hello friends,

I'm a struts newbe and I just can't find the
answer on the internet to that validation exception.
Does anyone know the answer? ... thx.

org.apache.commons.validator.ValidatorException:
org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest)

pretty strange, he?

Greetings


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Strange validation exception

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
The method signature in the FieldChecks class for the validateRequired()
method doesn't match what you have defined in the validation-rules.xml.

You probably have a version of validation-rules.xml from an older version of
struts and need to drop in the validation-rules.xml file that is shipped
with the version of Struts you are using. My guess is you've upgraded to
Struts 1.2.8, but haven't deployed the validation-rules.xml file that ships
with that version?

Niall

----- Original Message ----- 
From: "Holger Moosbauer" <hm...@tecon.de>
Sent: Wednesday, January 04, 2006 2:30 PM


> Thanks Ted,
>
> I already spent some hours on that issue. I just wanted to
> test the automatic form-validation - I'm a newbe and I performed
> the validation in the FormBean methode before.
> I just tried with the required-argument in the validation.xml ->
>
> <formset>
>       <form name="loginfb">
>         <field property="username" depends="required">
>           <arg0 key="fool" resource="false"/>
>         </field>
>       </form>
>     </formset>
>
> ...
>
> in the validator-rules.xml there is this entry
>
> <validator name="required"
>             classname="org.apache.struts.validator.FieldChecks"
>                method="validateRequired"
>          methodParams="java.lang.Object,
>                        org.apache.commons.validator.ValidatorAction,
>                        org.apache.commons.validator.Field,
>                        org.apache.struts.action.ActionMessages,
>                        javax.servlet.http.HttpServletRequest"
>                   msg="errors.required"/>
>
> so all seems quite OK, but it just don't work ... any idea? ... I just
want
> to use the
> predefined validators but I can't :-(
>
> Greetings and thx for any help
>
>
> -----Ursprüngliche Nachricht-----
> Von: Ted Husted [mailto:ted.husted@gmail.com]
> Gesendet: Mittwoch, 4. Januar 2006 14:52
> An: Struts Users Mailing List
> Betreff: Re: Strange validation exception
>
>
> In a situation like this, the best thing is to create a new
> application that contains just enough code to expose the error. Most
> often, in creating the application to expose the error, you will find
> the problem that is causing  the error. If not, you will have a
> concise example to post, so that other people will be able to help.
>
> -- HTH, Ted.
> http://www.husted.com/poe/
>
>
> On 1/2/06, Holger Moosbauer <hm...@tecon.de> wrote:
> > Hello friends,
> >
> > I'm a struts newbe and I just can't find the
> > answer on the internet to that validation exception.
> > Does anyone know the answer? ... thx.
> >
> > org.apache.commons.validator.ValidatorException:
> >
org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object,
> > org.apache.commons.validator.ValidatorAction,
> > org.apache.commons.validator.Field,
> org.apache.struts.action.ActionMessages,
> > javax.servlet.http.HttpServletRequest)
> >
> > pretty strange, he?
> >
> > Greetings
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


AW: Strange validation exception

Posted by Holger Moosbauer <hm...@tecon.de>.
Thanks Ted,

I already spent some hours on that issue. I just wanted to
test the automatic form-validation - I'm a newbe and I performed
the validation in the FormBean methode before.
I just tried with the required-argument in the validation.xml ->

<formset>
      <form name="loginfb">
        <field property="username" depends="required">
          <arg0 key="fool" resource="false"/>
        </field>
      </form>
    </formset>

...

in the validator-rules.xml there is this entry

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

so all seems quite OK, but it just don't work ... any idea? ... I just want
to use the
predefined validators but I can't :-(

Greetings and thx for any help


-----Ursprüngliche Nachricht-----
Von: Ted Husted [mailto:ted.husted@gmail.com]
Gesendet: Mittwoch, 4. Januar 2006 14:52
An: Struts Users Mailing List
Betreff: Re: Strange validation exception


In a situation like this, the best thing is to create a new
application that contains just enough code to expose the error. Most
often, in creating the application to expose the error, you will find
the problem that is causing  the error. If not, you will have a
concise example to post, so that other people will be able to help.

-- HTH, Ted.
http://www.husted.com/poe/


On 1/2/06, Holger Moosbauer <hm...@tecon.de> wrote:
> Hello friends,
>
> I'm a struts newbe and I just can't find the
> answer on the internet to that validation exception.
> Does anyone know the answer? ... thx.
>
> org.apache.commons.validator.ValidatorException:
> org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object,
> org.apache.commons.validator.ValidatorAction,
> org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
> javax.servlet.http.HttpServletRequest)
>
> pretty strange, he?
>
> Greetings
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Strange validation exception

Posted by Ted Husted <te...@gmail.com>.
In a situation like this, the best thing is to create a new
application that contains just enough code to expose the error. Most
often, in creating the application to expose the error, you will find
the problem that is causing  the error. If not, you will have a
concise example to post, so that other people will be able to help.

-- HTH, Ted.
http://www.husted.com/poe/


On 1/2/06, Holger Moosbauer <hm...@tecon.de> wrote:
> Hello friends,
>
> I'm a struts newbe and I just can't find the
> answer on the internet to that validation exception.
> Does anyone know the answer? ... thx.
>
> org.apache.commons.validator.ValidatorException:
> org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object,
> org.apache.commons.validator.ValidatorAction,
> org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages,
> javax.servlet.http.HttpServletRequest)
>
> pretty strange, he?
>
> Greetings
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org