You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Lorenzo Sicilia <ar...@kemen.it> on 2004/08/16 12:37:48 UTC

fmt:setLocale test it

Hi to all,

I have found a strange behavior of fmt:setLocale
I use jrun4, jstl 1.0.5 and mysql.

in my table "language" I have just some fields with special chars like 
"ç°§éùà..."


I have this simple page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ taglib prefix="c" uri="/WEB-INF/tld/c.tld" %>
<%@ taglib prefix="fmt" uri="/WEB-INF/tld/fmt.tld" %>
<%@ taglib prefix="sql" uri="/WEB-INF/tld/sql.tld" %>

<%--
	get data with special chars
--%>

<sql:query var="myQuery">
	SELECT * FROM language
</sql:query>

<%--
  loading text.
--%>
<fmt:setBundle basename="localtext" scope="page" />



<%
// bug fmt:setBundle. We need reset contentType
response.setContentType("text/html; charset=ISO-8859-1");
%>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>fmt:setLocale bug</title>
	</head>
	<body>
	
	<body>
		ContentType:<%=request.getContentType()%><br/>
		<fmt:message key="title" />
		
		------
		<c:forEach items="${myQuery.rows}" var="row">
			<c:out value="${row.name}"/><br />
		</c:forEach>
	</body>
</html>

It work fine only if i put:
response.setContentType("text/html; charset=ISO-8859-1");

I can't use <fmt:requestEnconding value="ISO-8859-1" />

from <%=request.getContentType()%> i get only null value

Some one can test it with tomcato or other application server?

tks in advance

Lorenzo Sicilia

--
KEMEN srl
http://www.kemen.it



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: fmt:setLocale test it

Posted by Lorenzo Sicilia <ar...@kemen.it>.
Lorenzo Sicilia wrote:
> It work fine only if i put:
> response.setContentType("text/html; charset=ISO-8859-1");

otherwise I get "?" from all special chars :)

regards Lorenzo

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org