Tom Ansley wrote:
Hi all,

I have a form that uses validator to check for simple validation like making
sure that a cash amount is a double.  I have the "cancel" button on the form
set so that if it is pressed that validation does not take place.  This is
great except when you type a letter into the cash text box and then press
cancel.  The form gets returned along with the invalid cash amount, the
BeanUtils attempts to populate the form and the whole thing falls over with
an exception.

Does somebody have a strategy for dealing with this situation?  Is there a
way of telling struts that if the cancel button is pressed that NO bean
population should take place?

No, there isn't; the form bean is always populated, cancel or no. The exception is probably caused by using typed properties in your form bean. You'd get the same problem submitting the form with invalid data as you do canceling it in that case.

You should make all your form bean properties String-typed to avoid these problems -- or at least all those that will be accepting user-supplied text inputs.

L.


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

Reply via email to