You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Michael Jouravlev <jm...@gmail.com> on 2005/07/15 04:11:06 UTC

Validator throws exception

I am trying to validate from properties. First I thought that error
was caused because I use nested properties (can I ?)

But now I have only one property, not nested, and I get this:

Jul 14, 2005 7:02:57 PM org.apache.struts.validator.ValidatorForm validate
SEVERE: org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Fi
eld, org.apache.struts.action.ActionMessages,
org.apache.commons.validator.Validator,
javax.servlet.http.HttpServletRequest)
org.apache.commons.validator.ValidatorException:
org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object,
org.apache.commons.validator.Validat
orAction, org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
org.apache.commons.validator.Validator,
javax.servlet.http.HttpServletReq
uest)
        at org.apache.commons.validator.ValidatorAction.loadValidationMethod(ValidatorAction.java:627)
        at org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:557)
        at org.apache.commons.validator.Field.validateForRule(Field.java:811)
        at org.apache.commons.validator.Field.validate(Field.java:890)
        at org.apache.commons.validator.Form.validate(Form.java:174)
        at org.apache.commons.validator.Validator.validate(Validator.java:367)
        at org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:112)
        at net.jspcontrols.dialogs.samples.mailreader.RegistrationForm.validate(RegistrationForm.java:88)

This is my form definition: public class RegistrationForm extends
ValidatorForm implements ICRUDForm  {
...
    String password2 = null;
    public String getPassword2() {return password2;}
    public void setPassword2(String password2) {this.password2 = password2;}
}

This is validation.xml:

<form-validation>
    <formset>
        <form name="RegistrationForm">
            <field property="password2"
                    depends="required">
                <arg   key="prompt.password2"/>
            </field>
        </form>
    </formset>
</form-validation>

Any insight? I have used Validator before.

Michael.

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


Re: [SOLVED] Validator throws exception

Posted by Amulya <CH...@BUPA.com>.
Probably you had new libraries(new version of struts) but old
validation-rules.xml file before....


Michael Jouravlev wrote:
> 
> On 7/14/05, James Mitchell <jm...@apache.org> wrote:
>> I see a stack trace below, but what is the actual error you got?
> 
> Hmm, it works on another machine, with different combination of
> struts/common libs. So, seems just a lib mixup.
> 
> Michael.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Validator-throws-exception-tf147799.html#a11393285
Sent from the Struts - User mailing list archive at Nabble.com.


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


[SOLVED] Validator throws exception

Posted by Michael Jouravlev <jm...@gmail.com>.
On 7/14/05, James Mitchell <jm...@apache.org> wrote:
> I see a stack trace below, but what is the actual error you got?

Hmm, it works on another machine, with different combination of
struts/common libs. So, seems just a lib mixup.

Michael.

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


Re: Validator throws exception

Posted by Michael Jouravlev <jm...@gmail.com>.
This is it, this is all I got. ValidationAction.validate() returns
null, no errors. I call validate() manually from action class, is this
OK?

On 7/14/05, James Mitchell <jm...@apache.org> wrote:
> Yes, you can use nested properties the same as anywhere else.
>
> I see a stack trace below, but what is the actual error you got?

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


Re: Validator throws exception

Posted by James Mitchell <jm...@apache.org>.
Yes, you can use nested properties the same as anywhere else.

I see a stack trace below, but what is the actual error you got?


--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
http://www.edgetechservices.net/
678.910.8017
AIM:   jmitchtx
MSN:   jmitchell@apache.org
Skype: jmitchtx

----- Original Message ----- 
From: "Michael Jouravlev" <jm...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Thursday, July 14, 2005 10:11 PM
Subject: Validator throws exception


I am trying to validate from properties. First I thought that error
was caused because I use nested properties (can I ?)

But now I have only one property, not nested, and I get this:

Jul 14, 2005 7:02:57 PM org.apache.struts.validator.ValidatorForm validate
SEVERE: 
org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Fi
eld, org.apache.struts.action.ActionMessages,
org.apache.commons.validator.Validator,
javax.servlet.http.HttpServletRequest)
org.apache.commons.validator.ValidatorException:
org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object,
org.apache.commons.validator.Validat
orAction, org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
org.apache.commons.validator.Validator,
javax.servlet.http.HttpServletReq
uest)
        at 
org.apache.commons.validator.ValidatorAction.loadValidationMethod(ValidatorAction.java:627)
        at 
org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:557)
        at 
org.apache.commons.validator.Field.validateForRule(Field.java:811)
        at org.apache.commons.validator.Field.validate(Field.java:890)
        at org.apache.commons.validator.Form.validate(Form.java:174)
        at 
org.apache.commons.validator.Validator.validate(Validator.java:367)
        at 
org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:112)
        at 
net.jspcontrols.dialogs.samples.mailreader.RegistrationForm.validate(RegistrationForm.java:88)

This is my form definition: public class RegistrationForm extends
ValidatorForm implements ICRUDForm  {
...
    String password2 = null;
    public String getPassword2() {return password2;}
    public void setPassword2(String password2) {this.password2 = password2;}
}

This is validation.xml:

<form-validation>
    <formset>
        <form name="RegistrationForm">
            <field property="password2"
                    depends="required">
                <arg   key="prompt.password2"/>
            </field>
        </form>
    </formset>
</form-validation>

Any insight? I have used Validator before.

Michael.

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