Bug 11238

Summary: EL evaluator doesn't find "time" property for java.util.Date
Product: Taglibs Reporter: Hans Bergsten <hans>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: CLOSED INVALID    
Severity: critical    
Priority: P3    
Version: 1.0   
Target Milestone: ---   
Hardware: All   
OS: All   

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"
	at
org.apache.taglibs.standard.tag.common.core.SetSupport.doEndTag(SetSupport.java:183)

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