tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <ahardy.str...@cyberspaceroad.com>
Subject character encoding issue
Date Sun, 14 Dec 2003 15:11:29 GMT
This is something I thought I had sorted out but somehow it popped its 
ugly head up again today.

I have tomcat 5.0.16 and I'm setting the character encoding for my JSPs 
in the web.xml with the new config mechanism:

   <jsp-config>
     <jsp-property-group>
       <description>All JSPs</description>
       <url-pattern>/WEB-INF/general/*</url-pattern>
       <el-ignored>false</el-ignored>
       <page-encoding>UTF-8</page-encoding>
       <is-xml>false</is-xml>
     </jsp-property-group>
   </jsp-config>

That handles the response and I fix the request by setting all request 
character encoding in a filter.

I have this simple JSP scriptlet:

<%
   String role = request.getParameter("role");
   if (role == null)
     role = "";
   if (role.length() > 0) {
     if (request.isUserInRole(role)) {
%>
       You have been granted role <strong><%= role %></strong><br /><br
/>
<%
     }
%>

But the JSP destroys my German characters like ä, ö & ü.

I put debug output in the JSP with the following:

request.getCharacterEncoding();
response.getCharacterEncoding();

It shows UTF-8 for both.

This does however setup work for my servlets, which successfully input & 
output the German characters between the browser and the database.

What am I doing wrong anybody?

Thanks
Adam
-- 
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian

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


Mime
View raw message