Thanks a lot.
I was under the misconception that it was sufficient to encode the
baseLayout.jsp I use in tiles with this line. Now I understand that
tiles has to knwo the encoding of every file in which it has control
over..
I guess the other solution also works well, but I use xdoclet, and hence
Servlet 2.3 spec.
Again, thanks for the prompt and to the point correct answer.
--
Olve
sÃn, 18.07.2004 kl. 02.46 skrev Jason Lea:
> iso-8859-1 is the default page encoding for web pages. To use anything else you
> need to tell the webserver.
>
>
> Use this at the top of every jsp page:
>
> <%@ page contentType="text/html; charset=UTF-8"%>
>
> Or for Tomcat 5 you can use Servelt 2.4/JSP2.0 spec and set the page
> encoding in the web.xml
>
> <jsp-config>
> <jsp-property-group>
> <url-pattern>*.jsp</url-pattern>
> <page-encoding>UTF-8</page-encoding>
> </jsp-property-group>
> </jsp-config>
>
>
> Olve SÃther Hansen wrote:
>
> >I have some problems using struts/tiles and UTF-8 characters embedded in
> >an jsp page.
> >
> >How can I make struts/tiles respect the system default encoding, and not
> >use iso-8859-1 for all jsp pages?
> >
> >This problem occurs in tomcat 4.1.29, 5.0.19 and 5.0.27.
> >I have a struts version bundled with Appfuse, all I know is that it is
> >from 2003-12.02 (that is 2. december).
> >
> >It seems like struts is hard-coding the response encoding to be
> >ISO-8859-1, although the response-encoding is set to be UTF-8 for all
> >requests..
> >
> >In a struts-action I execute this code:
> >log.debug("res encoding: " +response.getCharacterEncoding());
> >log.debug("req encoding: " +request.getCharacterEncoding());
> >
> >resulting in:
> >res encoding: ISO-8859-1
> >req encoding: UTF-8
> >
> >I use the SpringFramework characterEncodingFilter to force utf-8.
> >My web-browser reports the page to be encoded in utf-8.
> >
> >If I use iconv (a Linux program for converting files from one encoding
> >to another) to convert a file containing utf-8 characters (norwegian
> >characters à à Ã) to iso-8859-1, the pages displays correctly.
> >
> >My web-browser still reports the page as being encoded in utf-8.
> >
> >If I write the same Norwegian letters in a jsp page outside of
> >struts/tiles control, the page displays without problems..
> >
> >So, is there a way to make struts/tiles respect the system default
> >encoding, and not use iso-8859-1 for all jsp pages?
> >
> >Hope someone can help me solve this problem, I have looked through most
> >email archives I can find without any solution.
> >
> >
> >
--
Olve SÃther Hansen <[EMAIL PROTECTED]>
Intermedia/Aksis - Unifob AS
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]