You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mohammed Ibrahim <mi...@egain.com> on 2002/04/09 01:53:18 UTC

Content-Encoding - URGENT Please

Hi,
    I am having trouble setting the page content type and encoding on my JSP pages. The content on the JSP page is already in UTF-8 format and so we cannot use <%@ page %> tag to set content type and have to use HTML META TAG to set these headers. But tomcat alwasys sets the page encoding to western european ISO and browser is ignoring the META tag. The sam page works fine with Weblogic. Please help me resolve this problem.

Thanks
Gulshan


Re: Content-Encoding - URGENT Please

Posted by yilmaz <yi...@hwajet.com.tw>.
Marhaba Ibrahim,
I am not sure if someone else has already answered your question
If you are using JSP 1.2 or servlet 2.3 (if you use tomcat 4 ) then you can
use
response.setCharacterEncoding("UTF-8"); method.
I think this will work.
Cheers  :)
----- Original Message -----
From: "Mohammed Ibrahim" <mi...@egain.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, April 09, 2002 8:09 AM
Subject: Re: Content-Encoding - URGENT Please


> Hi Randy,
>     Thanks for the quick response. I tried using
>
> response.setContentType()
>
> method but it works the same way as <%@ page %> tag and tried to convert
the
> page content to UTF. since the content is already in UTF it gets messed
up.
> Is there a way we can set the default encoding header sent by the server
to
> the browser to utf-8?
>
> Thanks
> Gulshan
>
> ----- Original Message -----
> From: "randy melder" <rm...@cheerylynn.com>
> To: "'Tomcat Users List'" <to...@jakarta.apache.org>
> Sent: Monday, April 08, 2002 5:15 PM
> Subject: RE: Content-Encoding - URGENT Please
>
>
> > Look at the servlet API. There is a set content type function. I'm
> > sorry, I don't have it in front of me. But the answer is using a Servlet
> > API function.
> >
> > Good Luck,
> >
> > .randy
> >
> > /***************************************************
> > * Cheery Lynn Interactive, LLC
> > * http://www.cheerylynn.com/
> > * tel://602 279 0135
> > * --------------------Web Applications----------
> > ***************************************************/
> >
> >
> >
> > -----Original Message-----
> > From: Mohammed Ibrahim [mailto:mibrahim@egain.com]
> > Sent: Monday, April 08, 2002 4:53 PM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Content-Encoding - URGENT Please
> >
> > Hi,
> >     I am having trouble setting the page content type and encoding on my
> > JSP pages. The content on the JSP page is already in UTF-8 format and so
> > we cannot use <%@ page %> tag to set content type and have to use HTML
> > META TAG to set these headers. But tomcat alwasys sets the page encoding
> > to western european ISO and browser is ignoring the META tag. The sam
> > page works fine with Weblogic. Please help me resolve this problem.
> >
> > Thanks
> > Gulshan
> >
> >
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Content-Encoding - URGENT Please

Posted by Taavi Tiirik <ta...@ibs.ee>.
>     Could you please verify the path again as i cannot see the "filters"
> folder in classes? Also if you could please tell me what veresion of
tomcat
> you are using?

I am using 4.0.3. This filter may not be available for tomcat 3.2.x though.

Full path to SetCharacterEncodingFilter is as follows:

http://cvs.apache.org/viewcvs/jakarta-tomcat-4.0/webapps/examples/WEB-INF/cl
asses/filters/SetCharacterEncodingFilter.java

with best wishes,
Taavi



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Content-Encoding - URGENT Please

Posted by Mohammed Ibrahim <mi...@egain.com>.
Hi Taavi,
    Could you please verify the path again as i cannot see the "filters"
folder in classes? Also if you could please tell me what veresion of tomcat
you are using?

Thanks
Gulshan

----- Original Message -----
From: "Taavi Tiirik" <ta...@ibs.ee>
To: "Mohammed Ibrahim" <mi...@egain.com>
Cc: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, April 09, 2002 2:15 AM
Subject: Re: Content-Encoding - URGENT Please


> Strange... if you have example webapp then you should have this class
> as well.
>
> Look at http://cvs.apache.org/viewcvs/jakarta-tomcat-4.0/
> and browse to webapps/examples/WEB-INF/classes/filters
>
> The class is there.
>
> with best wishes,
> Taavi
>
> >     I could not find the specified class anywhere in the tomcat home
> folder.
> > Do i need to download something else for this class??
> >
> > Thanks
> > Gulshan
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Content-Encoding - URGENT Please

Posted by Taavi Tiirik <ta...@ibs.ee>.
Strange... if you have example webapp then you should have this class
as well.

Look at http://cvs.apache.org/viewcvs/jakarta-tomcat-4.0/
and browse to webapps/examples/WEB-INF/classes/filters

The class is there.

with best wishes,
Taavi

>     I could not find the specified class anywhere in the tomcat home
folder.
> Do i need to download something else for this class??
>
> Thanks
> Gulshan



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Content-Encoding - URGENT Please

Posted by Mohammed Ibrahim <mi...@egain.com>.
Hi Taavi,
    I could not find the specified class anywhere in the tomcat home folder.
Do i need to download something else for this class??

Thanks
Gulshan

----- Original Message -----
From: "Taavi Tiirik" <ta...@ibs.ee>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Cc: "Mohammed Ibrahim" <mi...@egain.com>
Sent: Tuesday, April 09, 2002 1:40 AM
Subject: Re: Content-Encoding - URGENT Please


> Gulshan,
>
> Please take a look at
>
/tomcat/webapps/examples/WEB-INF/classes/filters/SetCharacterEncodingFilter.
> java
> This filter should solve your problem. Documentation should be
> self-explanatory. If you
> get stuck anywhere do not hesitate to ask.
>
> with best wishes,
> Taavi
>
> > Hi Randy,
> >     Thanks for the quick response. I tried using
> >
> > response.setContentType()
> >
> > method but it works the same way as <%@ page %> tag and tried to convert
> the
> > page content to UTF. since the content is already in UTF it gets messed
> up.
> > Is there a way we can set the default encoding header sent by the server
> to
> > the browser to utf-8?
> >
> > Thanks
> > Gulshan
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Content-Encoding - URGENT Please

Posted by Taavi Tiirik <ta...@ibs.ee>.
Gulshan,

Please take a look at
/tomcat/webapps/examples/WEB-INF/classes/filters/SetCharacterEncodingFilter.
java
This filter should solve your problem. Documentation should be
self-explanatory. If you
get stuck anywhere do not hesitate to ask.

with best wishes,
Taavi

> Hi Randy,
>     Thanks for the quick response. I tried using
>
> response.setContentType()
>
> method but it works the same way as <%@ page %> tag and tried to convert
the
> page content to UTF. since the content is already in UTF it gets messed
up.
> Is there a way we can set the default encoding header sent by the server
to
> the browser to utf-8?
>
> Thanks
> Gulshan



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Content-Encoding - URGENT Please

Posted by Mohammed Ibrahim <mi...@egain.com>.
Hi Randy,
    Thanks for the quick response. I tried using

response.setContentType()

method but it works the same way as <%@ page %> tag and tried to convert the
page content to UTF. since the content is already in UTF it gets messed up.
Is there a way we can set the default encoding header sent by the server to
the browser to utf-8?

Thanks
Gulshan

----- Original Message -----
From: "randy melder" <rm...@cheerylynn.com>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
Sent: Monday, April 08, 2002 5:15 PM
Subject: RE: Content-Encoding - URGENT Please


> Look at the servlet API. There is a set content type function. I'm
> sorry, I don't have it in front of me. But the answer is using a Servlet
> API function.
>
> Good Luck,
>
> .randy
>
> /***************************************************
> * Cheery Lynn Interactive, LLC
> * http://www.cheerylynn.com/
> * tel://602 279 0135
> * --------------------Web Applications----------
> ***************************************************/
>
>
>
> -----Original Message-----
> From: Mohammed Ibrahim [mailto:mibrahim@egain.com]
> Sent: Monday, April 08, 2002 4:53 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Content-Encoding - URGENT Please
>
> Hi,
>     I am having trouble setting the page content type and encoding on my
> JSP pages. The content on the JSP page is already in UTF-8 format and so
> we cannot use <%@ page %> tag to set content type and have to use HTML
> META TAG to set these headers. But tomcat alwasys sets the page encoding
> to western european ISO and browser is ignoring the META tag. The sam
> page works fine with Weblogic. Please help me resolve this problem.
>
> Thanks
> Gulshan
>
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: Content-Encoding - URGENT Please

Posted by randy melder <rm...@cheerylynn.com>.
Look at the servlet API. There is a set content type function. I'm
sorry, I don't have it in front of me. But the answer is using a Servlet
API function.

Good Luck,

.randy

/***************************************************
* Cheery Lynn Interactive, LLC
* http://www.cheerylynn.com/
* tel://602 279 0135
* --------------------Web Applications----------
***************************************************/



-----Original Message-----
From: Mohammed Ibrahim [mailto:mibrahim@egain.com] 
Sent: Monday, April 08, 2002 4:53 PM
To: tomcat-user@jakarta.apache.org
Subject: Content-Encoding - URGENT Please

Hi,
    I am having trouble setting the page content type and encoding on my
JSP pages. The content on the JSP page is already in UTF-8 format and so
we cannot use <%@ page %> tag to set content type and have to use HTML
META TAG to set these headers. But tomcat alwasys sets the page encoding
to western european ISO and browser is ignoring the META tag. The sam
page works fine with Weblogic. Please help me resolve this problem.

Thanks
Gulshan



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>