tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johan Ekman <>
Subject fmt:message texts does not change when changing browser language ?
Date Wed, 22 Jan 2003 07:52:46 GMT

test.jsp looks as follows:

<%@ taglib uri="" prefix="fmt" %>

Browser using locale:<%=request.getLocale()%><br><br>

<jsp:useBean id="now" class="java.util.Date" />
<fmt:formatDate value="${now}" dateStyle="full" />
<fmt:setBundle basename="langfile"/>
<fmt:message  key="MYLANGUAGE"/>


I test.jsp run with browser language settings to 'sv', all works fine first
time the jsp compiles. Output:
Browser using locale:sv

den 22 januari 2003 Svenska

Changing language settings to 'en'. The locale has changed to 'en', date is
printed out in english but the fmt:message fiels is still in swedish.
Browser using locale:en

Wednesday, January 22, 2003 Svenska

My first theory was this hade somehow to do with the users locale being
stored in some session, but even closing all browsers and deleting all
cookies, the error still remains. It seems the only way to make it work is
to change the jsp page, causing it to be recompiled.

Rerunning it again now gives the correct output:
Browser using locale:en

Wednesday, January 22, 2003 English

However this does not seem a plausible solution. Has anyone else encountered
this problem ?

Thanks / Johan

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message