You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by bu...@apache.org on 2008/08/12 15:34:18 UTC
DO NOT REPLY [Bug 45620] New: formatDate fails when local is missing
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
DO NOT REPLY [Bug 45620] formatDate fails when locale is missing
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45620
Phil Dicke <ph...@aol.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|formatDate fails when local |formatDate fails when locale
|is missing |is missing
--
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
DO NOT REPLY [Bug 45620] formatDate fails when locale is missing
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45620
Henri Yandell <ba...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WONTFIX
--- Comment #2 from Henri Yandell <ba...@apache.org> 2009-07-10 00:37:45 PST ---
JSTL replaced the i18n taglib, so this won't be worked on.
--
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
DO NOT REPLY [Bug 45620] formatDate fails when locale is missing
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45620
--- Comment #1 from Nicky Sandhu <ni...@yahoo.com> 2009-02-09 16:53:37 PST ---
Another easy workaround without touching jsp pages is to set either the default
fallback locale or the default locale via web.xml configuration
<context-param>
<param-name>
javax.servlet.jsp.jstl.fmt.locale
</param-name>
<param-value>
en
</param-value>
</context-param>
<context-param>
<param-name>
javax.servlet.jsp.jstl.fmt.fallbackLocale
</param-name>
<param-value>
en
</param-value>
</context-param>
--
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