Hi all,
I'm using the fmt:formatDate tag and I discovered a strange behaviour:

When a JSP is requested without specifying the "Accept-Language" HTTP header 
and no locale has been explicitly set in the JSP, the date is not formatted 
and the result of Date.toString() is returned instead.

I checked the JSTL spec, this is what it says to do when the algorithm cannot 
find a Locale:
"If no match is found after the above two steps, it is up to the formatting 
action to take a corrective action."
I don't know what "corrective action" means in this context, but I think that 
using the default JVM locale would be much better than toString().

here's a sample JSP, you can test it with curl or wget:

<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"; %>
<jsp:useBean id="now" class="java.util.Date" />
<fmt:formatDate value="${now}" pattern="yyyy"/>

regards,
flavio tordini


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to