setLocale is needed for fmt:message
-----------------------------------
Key: STS-676
URL: http://www.stripesframework.org/jira/browse/STS-676
Project: Stripes
Issue Type: Bug
Components: Documentation
Affects Versions: Release 1.5.1
Reporter: Ward van Wanrooij
Priority: Minor
The documentation states at
http://www.stripesframework.org/display/stripes/Localization:
"Secondly, you should never have a need to use the <fmt:setLocale.../> tag.
Because of Stripes' strategy of using a filter and a request wrapper, all
components in your application, including the JSTL tags, will always get the
right locale when they call request.getLocale()."
However, the <fmt:message/> does not call request.getLocale() but instead some
other variables (more info at
http://osdir.com/ml/java.stripes.user/2007-03/msg00086.html), unlike the other
<fmt:*/> tags. You can reproduce this by creating a sample web application that
contains a class extending DefaultLocalePicker to return a hardcoded locale
(e.g. nl_NL), rename your StripesResources.properties to
StripesResources_nl.properties and use <fmt:message/> to include a localized
string. If you then request a page while sending no accept-language tags (for
example using telnet), you will see that only the <fmt:message/> refers to
???variables???, other localized values work as expected. This issue affects
Google as its bot does not send and language headers.
Workaround is to include <fmt:setLocale value="${pageContext.request.locale}"/>
in a common taglib before any <fmt:message/>. So, calling setLocale() is useful
in these cases.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development