You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "rickarde@glocalnet.net" <ri...@glocalnet.net> on 2007/03/20 17:06:09 UTC

Problems with request encodings

Hi

I'm using Tomcat 5.5, Struts and Tiles, now working on a smaller web
application that deals with forms and validation. To describe the
problem I'll give a short scenario:

FormPage1.jsp (having pageEncoding = ISO-8859-1 and charSet=ISO-8859-
1)
contains a form using the POST method.

When submitting this form to page2.jsp (page2.jsp using UTF-8 all
over), the swedish letters å, ä and ö (&aring, &auml; and &ouml) is
printed as '?', when, lets say, I use <%=request.getParameter
("companyName")%>

Tried to set request encoding (in page2.jsp) just below page directive
(request.setCharacterEncoding("UTF-8")) but it didn't help at all.


When I posted the same form to another jsp page (UTF-8 all over,
running under the same Tomcat instance, but in different application)
with no Struts at all, and no other java code than <%=request.
getParameter("companyName")%>, the swedish letters displayed just fine

Funny thing is, setting method=GET in form on FormPage1.jsp, makes
things work, and also if I set UTF-8 all over. But this is not an
option, due to external customers using their rip-offs forms sending 
in
request (Yes, I know it's not good custom, but my client decided that
should be allowed)

Now I wonder if there could be some problem with Tomcat encoding
settings or application settings (web.xml or such)???

By the way, using Eclipse as IDE on XP pro, but that shouldn't matter
in this case


Any suggestions???

/Rickard

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org