struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Onthrops <>
Subject Struts Forms, ConvertUtils and Validation - need design advice
Date Thu, 06 Jun 2002 16:19:21 GMT

I have a form that has one attribute - an instance of a value object. The object has multiple
attributes that make up the form elements. These attributes are not all Strings and therefore
ConvertUtils converts them to Strings for display on the jsp. When posting the html form,
ConvertUtils attempts to convert the input Strings back to the proper object Types. If the
input string is not in the .toString() format of the object, then an conversion exception
is thrown. 

Does this mean that I would need to have all input attributes of type String? That is, unless
I modify ConvertUtils to accept multiple string formats for my objects. What is the standard
practice for creating form attributes that are not Strings (i.e. Timestamp), populating them,
and validating them. Correct me if I'm wrong, but it seems that the validator assumes a String
attribute for validation.

Thanks in advance,


Do You Yahoo!?
Sign-up for Video Highlights of 2002 FIFA World Cup
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message