As part of localizing a site, I'm trying to set the content type of the response. Now I now I can do this within the JSP (<%@ page contentType="text/html; charset=UTF-8" %> ). But I'd rather do this globally. I found out that you can set this as a parameter of the controller in struts. This would work fine if the JSP compiler wasn't also setting the content type automatically.
So do someone know a container setting to do this ? Is there something like a "pre-compiler" for JSP, that would change/add code to each JSP before giving it to the JSP compiler ?
Thanks, Yann
I had this problem when I pre-compiled my JSPs (Tomcat 4.1.24).
If I don't pre-compile then (from memory) they were encoded correctly. I am using tiles, so the layout page set the encoding to UTF-8, then everything else is included into the layout. This might be why it worked, as the encoding was set on the parent JSP it was probably used when compiling the included pages.
When pre-compiling the JSPs each page is compiled separately. In this case I think it used the default Latin encoding.
I couldn't find a way to forcethe compiler to use a different encoding other than adding <%@ page contentType="text/html; charset=UTF-8"%> to the top of every JSP page (including it didn't seem to work).
-- Jason Lea
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]