This post originated from an RSS feed registered with Java Buzz
by Vinny Carpenter.
Original Post: JSTL and Locale
Feed Title: Vinny Carpenter's Blog
Feed URL: http://www.j2eegeek.com/error.html
Feed Description: Welcome to my blog. I am a total Java geek that lives in Milwaukee, making my living as an architect/developer, spending all my time with Java, J2EE, OO, Linux, and open source. In my spare time, when I am not in front of my computers, I spend every other minute with my other loves: My wife, books, music, guitars, Formula-1 racing and StarGate. Check out my blog @ http://www.j2eegeek.com/blog
Matt Raible was blogging about JSTL and internationalization in his blog in the entry entitled i18n - synching up Struts and JSTL. The blog talks about how to enable localized app and load the appropriate application resource property file.
We actually had to go the other way in our application. We didn't want to support localization and want to ignore the accept-language tag set in the user’s browser. We wanted to use en_US for everything and we achieved that by adding the following snippet in our web.xml file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<!-- Set the locale for all JSTL formatting --> <context-param> <param-name>javax.servlet.jsp.jstl.fmt.locale</param-name> <param-value>en_US</param-value> </context-param>