Bug 7230 - <fmt:parseDate> accepts invalid dates
Summary: <fmt:parseDate> accepts invalid dates
Status: RESOLVED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: unspecified
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-19 04:01 UTC by Hans Bergsten
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 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."