struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Hertz <>
Subject RE: validator integer required
Date Thu, 01 Apr 2004 22:49:28 GMT
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 



> -----Original Message-----
> From: Paul Barry [] 
> Sent: Thursday, April 01, 2004 5:38 PM
> To:
> 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:
For additional commands, e-mail:

View raw message