You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Roberto Nunnari <nu...@die.supsi.ch> on 2003/05/04 16:15:15 UTC

contentType

Hi there.

I'm using tomcat 4.1.12 to serve kind of xml pages to an application.
I'm using jsp.
I use
<%@page contentType="text/xml"%>
to set the right content type for the client application.

The problem is that tomcat automatically sets the charset with
a default value of iso-8859-1. That's very sensible for a web
broser client, but my client gets very upset with it.. it simply
doesn't want to receive the charset header.

Can any kind soul help me out with a way to have tomcat not to
set the charset header?

Thanks and best regards.
--
Roberto Nunnari


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: don't want tomcat to set 'charset' in jsp pages

Posted by Johannes Fiala <to...@fwd.at>.
Hi Robert,

=== copied from earlier response in this forum ===
Okay.  In your index.jsp, insert the following page directive to the very 
top...

<%@ page contentType="text/html; charset=iso-8859-1" %>

Let me know if the problem persists...
=== copied from earlier response in this forum ===

This seems to fix the header problem, doesn't it?

Johannes




Roberto Nunnari <nu...@die.supsi.ch> 
04.05.2003 19:26
Please respond to
"Tomcat Users List" <to...@jakarta.apache.org>


To
Tomcat Users List <to...@jakarta.apache.org>
cc

Subject
don't want tomcat to set 'charset' in jsp pages






Dear Johannes,

thanks for your replay.

But my problem is not that I want a different encoding.. My problem is
that I want tomcat -NOT set- the charset in the http header.

The client of this web application gets very upset when the http header
includes the charset in the ContentType header..
I need to find a way to tell
tomcat NOT set the charset.. and that should be specific to a web
application.. letting the other webapplication behave as usual.. the
ideal would be by using a directive in the .jsp page..

Roberto.


Johannes Fiala wrote:
> Hi Roberto,
> 
> 1.) If you compile your JSPs during runtime, you can set javaEncoding in 

> /conf/web.xml to change the charset used (search for javaEncoding 
there).
> 
> 2.) If you compile your JSPs using ant and Jspc, the default charset 
used 
> is UTF-8. If you want to change it, you have to change the Jspc.java 
file 
> or you can use the patch I created for it (
> More info: http://www.fwd.at/tomcat/build-using-ant-howto.html)
> 
> Johannes
> 
> 
> 
> 
> Roberto Nunnari <nu...@die.supsi.ch> 
> 04.05.2003 16:15
> Please respond to
> "Tomcat Users List" <to...@jakarta.apache.org>
> 
> 
> To
> tomcat-user@jakarta.apache.org
> cc
> 
> Subject
> contentType
> 
> 
> 
> 
> 
> 
> Hi there.
> 
> I'm using tomcat 4.1.12 to serve kind of xml pages to an application.
> I'm using jsp.
> I use
> <%@page contentType="text/xml"%>
> to set the right content type for the client application.
> 
> The problem is that tomcat automatically sets the charset with
> a default value of iso-8859-1. That's very sensible for a web
> broser client, but my client gets very upset with it.. it simply
> doesn't want to receive the charset header.
> 
> Can any kind soul help me out with a way to have tomcat not to
> set the charset header?
> 
> Thanks and best regards.
> --
> Roberto Nunnari
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



don't want tomcat to set 'charset' in jsp pages

Posted by Roberto Nunnari <nu...@die.supsi.ch>.
Dear Johannes,

thanks for your replay.

But my problem is not that I want a different encoding.. My problem is
that I want tomcat -NOT set- the charset in the http header.

The client of this web application gets very upset when the http header
includes the charset in the ContentType header..
I need to find a way to tell
tomcat NOT set the charset.. and that should be specific to a web
application.. letting the other webapplication behave as usual.. the
ideal would be by using a directive in the .jsp page..

Roberto.


Johannes Fiala wrote:
> Hi Roberto,
> 
> 1.) If you compile your JSPs during runtime, you can set javaEncoding in 
> /conf/web.xml to change the charset used (search for javaEncoding there).
> 
> 2.) If you compile your JSPs using ant and Jspc, the default charset used 
> is UTF-8. If you want to change it, you have to change the Jspc.java file 
> or you can use the patch I created for it (
> More info: http://www.fwd.at/tomcat/build-using-ant-howto.html)
> 
> Johannes
> 
> 
> 
> 
> Roberto Nunnari <nu...@die.supsi.ch> 
> 04.05.2003 16:15
> Please respond to
> "Tomcat Users List" <to...@jakarta.apache.org>
> 
> 
> To
> tomcat-user@jakarta.apache.org
> cc
> 
> Subject
> contentType
> 
> 
> 
> 
> 
> 
> Hi there.
> 
> I'm using tomcat 4.1.12 to serve kind of xml pages to an application.
> I'm using jsp.
> I use
> <%@page contentType="text/xml"%>
> to set the right content type for the client application.
> 
> The problem is that tomcat automatically sets the charset with
> a default value of iso-8859-1. That's very sensible for a web
> broser client, but my client gets very upset with it.. it simply
> doesn't want to receive the charset header.
> 
> Can any kind soul help me out with a way to have tomcat not to
> set the charset header?
> 
> Thanks and best regards.
> --
> Roberto Nunnari
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: contentType

Posted by Johannes Fiala <to...@fwd.at>.
Hi Roberto,

1.) If you compile your JSPs during runtime, you can set javaEncoding in 
/conf/web.xml to change the charset used (search for javaEncoding there).

2.) If you compile your JSPs using ant and Jspc, the default charset used 
is UTF-8. If you want to change it, you have to change the Jspc.java file 
or you can use the patch I created for it (
More info: http://www.fwd.at/tomcat/build-using-ant-howto.html)

Johannes




Roberto Nunnari <nu...@die.supsi.ch> 
04.05.2003 16:15
Please respond to
"Tomcat Users List" <to...@jakarta.apache.org>


To
tomcat-user@jakarta.apache.org
cc

Subject
contentType






Hi there.

I'm using tomcat 4.1.12 to serve kind of xml pages to an application.
I'm using jsp.
I use
<%@page contentType="text/xml"%>
to set the right content type for the client application.

The problem is that tomcat automatically sets the charset with
a default value of iso-8859-1. That's very sensible for a web
broser client, but my client gets very upset with it.. it simply
doesn't want to receive the charset header.

Can any kind soul help me out with a way to have tomcat not to
set the charset header?

Thanks and best regards.
--
Roberto Nunnari


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org