Bug 7801 - <fmt:formatDate> will fail at runtime if value is an empty String ("").
Summary: <fmt:formatDate> will fail at runtime if value is an empty String ("").
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 21:23 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 21:23:30 UTC
Given:

   <fmt:formatDate value=""/>

Result:

   Exception thrown from tag stating "" is unparsable.

Section 9.8 page 9-107 of PD spec, Null & Error Handling:

"If value is null or empty, the action does nothing."

Proposed fix:

Index: FormatDateSupport.java
===================================================================
RCS file:
/home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/fmt/FormatDateSupport.java,v
retrieving revision 1.15
diff -u -r1.15 FormatDateSupport.java
--- FormatDateSupport.java	20 Mar 2002 20:59:49 -0000	1.15
+++ FormatDateSupport.java	6 Apr 2002 21:22:03 -0000
@@ -149,10 +149,11 @@
 
	    && ((bcs = bc.getString()) != null)) {
 
	value = bcs.trim();
 	    }
-
    if ((value == null) || value.equals("")) {
+
}
+
+
if ((value == null) || value.equals("")) {
 
	// do nothing
 
	return EVAL_PAGE;
-
    }
 	}
 
 	/*
Comment 1 Jan Luehe 2002-04-08 22:41:45 UTC
Fixed.