Bug 7799

Summary: <fmt-rt:formatDate> fails to accept an RT value of type java.util.Date
Product: Taglibs Reporter: Ryan Lubke <Ryan.Lubke>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: major    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Ryan Lubke 2002-04-06 17:53:47 UTC
Given:

<fmt-rt:formatDate value='<%= new Date(102142631861L) %>'/>

Error returned during compilation phase:
Incompatible type for method. Can't convert java.util.Date to java.lang.String.


Section 9.8 of the PD spec, page 9-107. 
The type field shows that both String and java.util.Date are value input types
for the value attribute.


The patch below seems to work ok.

*****************************************
Index: FormatDateTag.java
===================================================================
RCS file:
/home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/rt/fmt/FormatDateTag.java,v
retrieving revision 1.7
diff -u -r1.7 FormatDateTag.java
--- FormatDateTag.java	9 Mar 2002 00:55:59 -0000	1.7
+++ FormatDateTag.java	6 Apr 2002 17:52:31 -0000
@@ -73,7 +73,7 @@
     // Accessor methods
 
     // 'value' attribute
-    public void setValue(String value) throws JspTagException {
+    public void setValue(Object value) throws JspTagException {
         this.value = value;
 	this.valueSpecified = true;
     }
****************************
Comment 1 Jan Luehe 2002-04-06 19:39:17 UTC
Fixed.