struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <ahardy.str...@cyberspaceroad.com>
Subject Re: Working with UTF-8 and problems with German Umlauts
Date Mon, 03 Nov 2003 22:31:39 GMT
On 11/03/2003 09:43 PM Zsolt Koppany wrote:
> I have problems with German Umlauts when I enter the code below to my jsp
> pages. The problem is when I for example I forget to fill a required field
> and the previous values are restored after validation.
> 
> How can I fix that?
> 
> I use tomcat-4.1.24 with struts-1.1.
> 
> 
> <%@ page contentType="text/html; charset=UTF-8" %>
> 
> <%request.setCharacterEncoding("UTF8");%>

Hi Zsolt,
you are setting your character encoding way too late in the game. By the 
point you set it in the JSP as you show above, Struts has already read 
the request parameters into your form.

A common method of setting the character encoding for struts is using a 
filter, so the request is character-encoded before struts gets to see it.

Adam


-- 
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9

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


Mime
View raw message