Bug 11238 - EL evaluator doesn't find "time" property for java.util.Date
Summary: EL evaluator doesn't find "time" property for java.util.Date
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: 1.0
Hardware: All All
: P3 critical (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2002-07-28 02:44 UTC by Hans Bergsten
Modified: 2004-11-16 19:05 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Hans Bergsten 2002-07-28 02:44:51 UTC
For some non-obvious reason, the following action sequence

  <jsp:useBean id="exp" class="java.util.Date" />
  <c:set target="exp" property="time" value="0" />

results in this error

  javax.servlet.jsp.JspTagException: Invalid property in <set>:  "time"

using Tomcat 4.0.4. The java.util.Date class has a setDate(long) method, as well
as a getDate() method returning long, and there are no inherited methods with
the same names but different types that can interfer with the introspection.
In fact, running the introspection on the Date class in a test class finds a
property named "time" correctly.
Comment 1 Shawn Bayern 2002-07-28 02:56:10 UTC
In your example, "exp" is a java.lang.String, which has no 'time' property; 
${exp} is a java.util.Date, which does.  :)
Comment 2 Hans Bergsten 2002-07-28 03:02:45 UTC
How embarrasing; you wouldn't believe how much time I spent trying to make sure
I didn't do anything wrong and looking for other reasons before I sumbitted the 
bug report ;-)