I use MyEclipse to compile my program,and I want to achieve internationalization, so I choose use the fmt
tag.
The follow is the code:
<fmt:setLocale value="${param.locale }" scope="session" />
Book says that ${param.locale }
can get the browser's default-language
. In order to change the language, I use two languages, English and Chinese. Though I set the browser's default-language
to English, when I reload the jsp page, the language is always Chinese. Could you tell me what's the matter?
full codes:
<%@ taglib prefix="fmt" uri="java.sun.com/jsp/jstl/fmt"; %>
<fmt:setLocale value="${param.locale }" scope="session" /> <fmt:setBundlebasename="loginpage"/> <input type="text" id="text1" /> <br/> <input type="password" id="text2" /> <br /> <input type="submit" id="smb" value="<fmt:message key="login_sub" />" />
" /> – Bruce Li Dec 19 '12 at 07:33