DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27321>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27321 Automatic invalid format handling for form bean ------- Additional Comments From [EMAIL PROTECTED] 2004-03-01 14:40 ------- I think current release of Struts already has the package Ted wants. When populating a form bean, BeanUtils (Commons project) use Converter to transform String type to a native type. You can configure a custom converter as a plugin. However, it is used only half way, the transformation from bean value to display string on html does not use converter. If <html> tags use converter, it can fulfill the transformation from native value to whatever you want to display. I agree with Ted it is beneficial to handle data validation, tranformation, and conversion from a single configuration. Treating form bean as container of other objects (so non-String types are allowed) help this process. In theory we need something as an exact copy of html form values on the server. But because Servlet api provides request parameters to fulfill this, we may push ActionForm nearer to the model tier. As for JSF, it's still a proposed draft and most projects using Struts won't have it in the near future. And JSF is a different model that incurs learning curve. I believe it's beneficial that Struts takes this into its own hand. Please notice that my proposal for this enhancement targets a related but different problem. Even if you have the converters, the user could still input an invalid value. Converter still throws an exception on that. My proposal wants Struts to automatically handle the exception as it does for validation error. Without this, form bean has to have String type so converters are useless. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]