tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julien Martin" <>
Subject SOS JSTL
Date Wed, 24 Sep 2003 11:00:47 GMT

I am developing an application that uses Jstl for internationalization.  I
store a string called "lang" in a request attribute (${requestScope.lang}).
This string is either "fr" or "es".
My page is sometimes in french even though the lang attribute is "es" and
vice versa.  It seems as if the  ${requestScope.lang} is ignored.

Can anyone help please?

Thanks in advance,


Here is the full content of my jsp:

<%-- ==================================================

Index Page

================================================== --%>

<%@ page import ="com.parispano.latinamericaguide.*" %>

<%@ taglib uri="/WEB-INF/c.tld" prefix="f" %>

<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %>

<%@ taglib uri="/WEB-INF/latinamericaguide.tld" prefix="po" %>


/* We retrieve the Countries object from the servlet context. */

ServletContext sc = getServletContext();

Countries cs = (Countries)sc.getAttribute("countries");

/* We apply the sorting criterion. */

String sortCriterion = request.getParameter("sortCriterion");

Country[] countryArray = cs.getArray(sortCriterion);


<fmt:setLocale value="${requestScope.lang}"/>

<fmt:bundle basename="com.parispano.latinamericaguide.resources.labels">



<title><fmt:message key="title_index_jsp"/></title>

<link rel="StyleSheet" type="text/css" href="css/latinamericaguide.css"/>



<div id="logo_home">

<img src="./media/logo_atlas.gif" alt="">


<div id="advertisement">

<jsp:directive.include file="pages/modules/indexmodule.jsp" />


<div id="left-column">

hola toto


<div id="country-list-box">

<div id="language">

current language: ${requestScope.lang}<br />

Language locale="${requestScope.lang}"/>>Change Language</a><br /><br


<div id="top-left">

<div id="top-right">



<div id="title">

<img src="./media/<po:I18nlizeImage imageName="atlas_latino"
locale="${requestScope.lang}"/>" alt="">


<div id="sortingForm">

<jsp:directive.include file="pages/sorterForm.jsp" />




<th><fmt:message key="country_index_jsp"/></th>

<th><fmt:message key="capital_index_jsp"/></th>

<th><fmt:message key="landarea_index_jsp"/></th>

<th><fmt:message key="population_index_jsp"/></th>

<th><fmt:message key="gdp_index_jsp"/></th>

<th><fmt:message key="gdp_per_capita_index_jsp"/></th>

<th><fmt:message key="more_index_jsp"/></th>



int rowCol=0;

for(int i=0; i<countryArray.length; i++){


Country country = (Country)countryArray[i];

out.println("<tr " +
((rowCol%2==0)?("class=\"evenRow\""):("class=\"oddRow\"")) + ">");

out.println("<td class=\"countryName\">" +country.getName() + "</td>");

out.println("<td class=\"countryCapital\">" +country.getCapital() +

out.println("<td class=\"number\">" + country.getFormattedLandArea() +

out.println("<td class=\"number\">" +country.getFormattedPopulation() +

out.println("<td class=\"number\">" +country.getFormattedGdp() + "</td>");

out.println("<td class=\"number\">" +country.getFormattedGdp_per_head() +

out.println("<td><a class=\"more\" href=\"pais.jsp?countryID=" +
country.getId() + "\">más...</a></td>");





<div id="bottom-left">

<div id="bottom-right">



<jsp:directive.include file="./pages/footer.jsp"/>


<br />




  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message