Rivka Shisman wrote:
Hi again
When you say that validation doesn't work when inserting "ABC" in an
integer field - do you mean when using struts Validator?
I'm not using the Validator - I just add "if myInteger < 1 " in method
validate().
If I define myInteger as String - how do I check that it's a valid
number in the validate() method (without using Validator)?
Doesn't matter if you use validation or not, if you define a form
property as Integer for example (in the form class and in struts-config)
and then if you write "abc" in this field, you will get a
ConversionException because the first step that Struts makes in the
RequestProcesor is to "populate" the form bean i.e. to match the
parameters that are comming with the request and "transform" them to the
form proiperties.
After that the validation works, but even if you don't validate the
forms with the Validator, the populations you can't avoid or change.
Thus you are forced to define your form properties as String (because in
the http request anyway they ARE strings, just Struts during the
population tries to convert them to the types defined in struts-config).
Just make a little test and you will udnerstand the problem ...
Borislav
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]