This tip shows how to use the JSTL internationalization actions. Our web application consists of a JSP page and required number of resource bundles (English is given in example).

Switching locales is easy for the JSP page - just change the value specified for the action. The resource bundle has a base name set to my.messages. That resource bundle base name tells the JSP container that your messages resource bundle corresponds to a properties file (or a Java class file) in the WEB-INF/classes/my/:

English properties file

   page.title=Localizing Messages Company, Inc.
   company.slogan=We Are The Best
<%@ taglib uri='' prefix='fmt'%>


////////////// specify a locale and a resource bundle base name for the 
////////////// <fmt:message> actions in this page
		<fmt:setLocale value='en'/>
		<fmt:setBundle basename='my.messages'/>
		<%-- Use <fmt:message> to display the page title --%>
			<fmt:message key='page.title'/>


////////////// Use <fmt:message> to display localized messages from the 
////////////// com.acme.messages resource bundle 
		<font size='5'>
			<fmt:message key=''/>
		<p><fmt:message key='company.slogan'/> </p>
		<hr />