The fmt:setLocale value doesn't change for the scope. The value can only be fixed the first time, but subsequent invocations changing the value doesn't work fine. If we have one Jsp that is used to fix the language of an aplication, if the language is changed using fmt:setLocale whit scope="sessio", the other JSP don't catch this change when they use fmt:message. I'm using jboss-3.0.3_tomcat-4.1.12 ang I have changed the conf/web.xml enablePooling to false. Is the same problem that is described in http://www.mail-archive.com/taglibs-user@jakarta.apache.org/msg04074.html. Thanks.
Created attachment 4738 [details] Example <fmt> usage that doesn't work fine.
The attachment is a war file that contains an example of <fmt> usage that doesn't work fine. I attached with the name fmtexample.war. It can be deployed simply copying the war file to the deploy directory.
The sample code provided fails to give the proper locale because <fmt:setLocale> is used erroneously. The code in manager.jsp has the following: <fmt:setLocale value="<%=lang%>" scope="session"/> This should throw an exception at translation time because attributes in EL tag libraries have <rtexprvalue> set to false. The string literal "<%=lang%>" is passed as is to the tag handler. You can fix your sample code in the following ways and it will then work fine. Use the RT tag library: <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt_rt" %> ... <fmt_rt:setLocale value="<%=lang%>" scope="session"/> Or expose the scripting variable as a scoped variable and use the EL taglib: request.setAttribute("lang", lang); ... <fmt:setLocale value="${lang}" scope="session"/>
Thank you and sorry for my error.