Internacionalizace a lokalizace - příklad

<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<c:if test="${lang==null}">
 <fmt:setBundle basename="com.heaton.bundles.Forum" 
    var="lang" scope="session"/>
</c:if>
<c:if test="${param.lang!=null}">
 <fmt:setLocale value="${param.lang}"/>
 <fmt:setBundle basename="com.heaton.informit.I18NBundle" 
    var="lang" scope="session"/>
 <c:redirect url="index.jsp"/>
</c:if>
<html><head><title>I18N Example</title></head>
<body>
    <h1><fmt:message key="login.pleaselogin" bundle="${lang}"/></h1>
    <form method=post action=main.jsp>
        <fmt:message key="login.uid" bundle="${lang}"/><input name=uid><br/>
        <fmt:message key="login.pwd" bundle="${lang}"/><input name=pwd><br/>
        <input type="submit" name="action" value="<fmt:message 
        key="login.title" bundle="${login}"/>">
    </form>
    <h1><fmt:message key="login.language" bundle="${lang}"/></h1>
    <ul>
        <li><a href="index.jsp*lang=en">
        <fmt:message key="login.english" bundle="${lang}"/>(English)</li>
        <li><a href="index.jsp*lang=es">
        <fmt:message key="login.spanish" bundle="${lang}"/>(Spanish)</li>
    </ul>
</body></html>