struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Kindler <>
Subject type conversion versus validation
Date Tue, 31 Mar 2009 12:03:32 GMT
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.

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 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 


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message