jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 45620] New: formatDate fails when local is missing
Date Tue, 12 Aug 2008 13:34:18 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=45620

           Summary: formatDate fails when local is missing
           Product: Taglibs
           Version: unspecified
          Platform: All
        OS/Version: Windows XP
            Status: NEW
          Keywords: NeedsReleaseNote
          Severity: normal
          Priority: P2
         Component: I18N Taglib
        AssignedTo: taglibs-dev@jakarta.apache.org
        ReportedBy: philci52@aol.com


Some browsers (IE from GoogleEarth) do not pass local information in the HTTP
header for the request, therefore request.getLocale() returns null.  When this
happens the following tag fails even though a pattern and timezone are
specified:

<fmt:formatDate value="${d}" pattern="yyyy-MM-dd HH:mm z" timeZone="GMT"/>
The above just prints out d.toString()

SimpleDateFormat has all the elements it needs for a successful format, it
should format the date as expected instead of using d.toString()


Workaround:
You can add the following to your JSP and it will work.
<c:choose>
    <c:when test="${request.locale == null}">
        <fmt:setLocale value="en_US" />
    </c:when>
</c:choose>


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Mime
View raw message