Bug 7230

Summary: <fmt:parseDate> accepts invalid dates
Product: Taglibs Reporter: Hans Bergsten <hans>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Hans Bergsten 2002-03-19 04:01:38 UTC
A date string like 2002-03-50, with pattern yyyy-MM-dd, does not cause an
exception. The reason is that DateFormat parse() adjusts dates like this
to a real date by default. To get the expected behavior, setLenient(false)
must be used.

Maybe this needs to be clarified in the spec as well.
Comment 1 Jan Luehe 2002-03-20 20:55:14 UTC
Date parsing has been changed to be non-lenient, and the spec has been clarified
as follows:

- <fmt:formatDate>:

Add the following sentence to the end of the paragraph that starts with "If the
input to the value attribute is a string literal [...]".

  "Parsing is non-lenient, that is, the string in the value attribute
  must strictly adhere to the parsing format."


- <fmt:parseDate>:

Add a new, one-sentence paragraph right after the paragraph that
starts with "If the given date string uses a different format [...]":

  "Parsing is non-lenient, that is, the given date string must strictly adhere
  to the parsing format."