Bug 7799 - <fmt-rt:formatDate> fails to accept an RT value of type java.util.Date
Summary: <fmt-rt:formatDate> fails to accept an RT value of type java.util.Date
Status: RESOLVED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: unspecified
Hardware: All All
: P3 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-06 17:53 UTC by Ryan Lubke
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.