tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joakim Verona <>
Subject lameness with jsp:setproperty for non-basic types
Date Thu, 18 May 2000 12:59:40 GMT

i'm experiencing a problem when setting non-basic properties with jsp:setproperty.
ok, the problem is maybe to the spec, but its still irritating, and i wonder if anybody has
a neat solution to it?

say that you have a bean, with date properties for instance. you want the bean to have get/set
for the date property. but in your forms, you must send strings. jsp:setproperty does not
convert the string to a date, so you must do it yourself.

ok, so you add a setDate(String s) overloaded method, (you already have a setDate(Date d)
of course).
But this breaks the bean introspection code in tomcat, so this is not possible.

so then you must rename the setDate to setDateStr or someting similar, and handle the string->object
conversion yourself.

this is inconvenient and voids the elegance of setproperty * in my opinion.

i assume this is well-known, but is there any more elegant solutions, or proposals for the
future behaviour of tomcat?

Joakim Verona

View raw message