Well, it's not the *expected* behavior.

First thing -- I'd make id a String. The validator parses String properties. 
Not having looked into the validator code myself, I suppose "required" 
*could* work for a non string property, but I sure wouldn't try it with a 
primative like int. Integer might have better results, but I'm speculating. 

Just make id a String in the form and be done with it.

Aside from that, std questions about validator setup:

Is validate="true" on your ActionMapping?

Are we talking about a ValidatorForm or a ValidatorActionForm? With the 
letter, you validate the Mapping name. with the former you validate the form 
name?

HTH,

Joe

> -----Original Message-----
> From: Paul Barry [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, April 01, 2004 5:38 PM
> To: [EMAIL PROTECTED]
> Subject: validator integer required
> 
> 
> I have an ActionForm with an int property called id.  If I use the 
> validator \"required\" validation, it always passes the 
> validation, even 
> if there is no request parameter called id.  Is this is correct 
> behavior, or am I doing something wrong?



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to