You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Christian Kindler <li...@kruescho.de> on 2009/03/31 14:03:32 UTC
type conversion versus validation
Hi there,
when using domain objects in a struts action I'm facing the problem that
type conversion throws an error before validation is executed when
having non string properties.
Example:
in my action I have a property organization which has itself a property
contact. The contact object has a zipcode property which is accessed in
the view via organization.contact.zipcode. Because in germany a zipcode
is 5 digit integer, the zipcode property in the contact class is an int.
When a user inserts a non integer in the zipcode field, the type
conversion complains before validation can match.
What is the best practice in such a case? I will not rely on client side
validation.
Regards
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org