You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Axel Stahlhut <as...@neusta.de> on 2002/11/21 20:48:33 UTC

[Validator] - Strange behaviour and not validating

Hi.

I encounter a strange behaviour of the Struts-Validator (Struts 1.1b2):
In validator.xml I set up the following rules:

<field property="glEmpId"
depends="required,long">
<arg0 key="ab"/>
<arg1 key="error.required"/>
</field>
<field property="name"
depends="required">
<arg0 key="global.name"/>
<arg1 key="error.required"/>
</field>

Inside the form I've got the following:
<html:select property="glEmpId">
<html:option value="x"><bean:message
key="global.yourSelection"/></html:option>
</html:select>

The Validator validates the field name correct. The field glEmpId is not
validated at all! It doesnt matter if I send the "x" or an empty String, in
both cases one of the Validators (required or long) should generate an
ActionError, shouldn't it? What am I doing wrong here?

By the way, does anybody know, why the validator example in the newest
Struts nightly builds (which iI don't use) is broken? Will it be fixed?

Thanks
Axel



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Validator] - Strange behaviour and not validating

Posted by Robert Leland <rl...@apache.org>.
Axel Stahlhut wrote:
> 
> By the way, does anybody know, why the validator example in the newest
> Struts nightly builds (which iI don't use) is broken? Will it be fixed?
> 
> Thanks
> Axel

There is a know problem with the commons-validator:

See:
    http://jakarta.apache.org/struts/userGuide/dev_validator.html


Perhaps this is your problem ?

-Rob


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>