Hi list,

I�m using Tiles with Catalina (4.1.29 on Linus and
Windows). and I�m having problems setting the
response�s encoding to UTF-8.

I added:
<%@ page contentType="text/html;charset=UTF-8"
pageEncoding-"UTF-8" %>
to all my JSP pages � tiles and layouts. It is the
first line of each page.

So now, all my JSPs call 
ApplicationHttpResponse.setContentType *before*
accessing the page�s writer.

Here is the code for setContentType:
public void setContentType(String type) {
        if (!included)
            getResponse().setContentType(type);
}

The problem is that the body of setContentType is
never executed because each time a JSP calls it,
included is true (I verified by stepping through the
code with a debugger), which means we are inside a
RequestDispatcher.include(). My guess is that it's
Tiles or Struts that causes the request to be dispatch
via  RequestDispatcher.include.

I tried to set the response�s content type in a
filter,  but when I check in my custom tags,
pageContext.getResponse().pageContext.getResponse()
always returns ISO-8859-1, Tomcat�s default encoding.

Setting the encoding in a JSP works fine as long as
Struts/Tiles are not involved.

Can somebody please shed some light on this? Do you
know of another way of setting the encoding, that can
occur before the JSPs are processed?
I want to avoid having to build a custom version of
Tomcat with UTF-8 as the default encoding. 

Thanks for your time,

Sophia.

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to