Bug 7801

Summary: <fmt:formatDate> will fail at runtime if value is an empty String ("").
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 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.