You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Bill Brown <wb...@colorfulsoftware.com> on 2008/04/04 20:48:14 UTC

JSP Charset encoding issue

Greetings: 

I am checking the standards compliance for some of my jsp pages that render
as XHTML.  I have run into the issue where my jsp file is encoded as UTF-8
(according to the eclipse editor) and it includes the <?xml version="1.0"
encoding="UTF-8"?> at the top of the file.  However Firefox / IE6 and the
validator site are reporting that the http-header for encoding being sent is
ISO-8859-1 and so the page breaks for that validation.  Here is the response
header: 

Date: Fri, 04 Apr 2008 18:43:47 GMT
Server: Apache/2.2.4 (Ubuntu) DAV/2 SVN/1.4.4 mod_jk/1.2.23 mod_ssl/2.2.4
OpenSSL/0.9.8e
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Type: text/html;charset=ISO-8859-1
Via: 1.1 127.0.0.1
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked

Is there a setting somewhere in geronimo I can use to set the Content-Type
header to UTF-8 ? 

Thanks for your feedback.  
Bill. 

-- 
View this message in context: http://www.nabble.com/JSP-Charset-encoding-issue-tp16495245s134p16495245.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: JSP Charset encoding issue

Posted by Bill Brown <wb...@colorfulsoftware.com>.
Greetings David: 


Thanks for finding that information.  That fixed the issue for the http
ContentType header (posted below).  I didn't digg too much but for an
indication that just setting the xml content encoding should affect the http
header charset.  What I found was this article
http://skew.org/xml/misc/xml_vs_http/  which has some interesting discussion
of xml over http.

(Just Geronimo)
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=UTF-8
Transfer-Encoding: chunked
Date: Sun, 06 Apr 2008 00:47:47 GMT

200 OK

(Behind apache) 
Date: Sun, 06 Apr 2008 00:46:42 GMT
Server: Apache/2.2.4 (Ubuntu) DAV/2 SVN/1.4.4 mod_jk/1.2.23 mod_ssl/2.2.4
OpenSSL/0.9.8e
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Type: text/html;charset=UTF-8
Via: 1.1 127.0.0.1
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked

200 OK

Thanks again and take care.
Bill.


This area is pretty much a mystery wrapped in an enigma to me, but I  
found
http://www.w3.org/International/O-HTTP-charset
which indicates jsps should set the charset using a page directive

<%@ page contentType="text/html; charset=UTF-8" %>

Do you have some indication that just setting the xml content  
encoding should affect the http header charset?

thanks
david jencks


On Apr 4, 2008, at 6:05 PM, Bill Brown wrote:

>
> Greetings Jarek:
>
> I tried your recommendation and it looks like the embedded tomcat in
> geronimo is also giving the same ISO-8859-1 header response.  Here  
> is what I
> have without apache in front:
>
> Server: Apache-Coyote/1.1
> Content-Type: text/html;charset=ISO-8859-1
> Transfer-Encoding: chunked
> Date: Sat, 05 Apr 2008 01:01:49 GMT
>
> 200 OK
>
> Do you think there is some configuration I can do to the embedded  
> tomcat
> running in geronimo?
>
> Thanks for looking at this.
> Bill.
>
>
>
> Jarek Gawor-2 wrote:
>>
>> Is your Geronimo server running behind Apache httpd server? The
>> "server" header looks like it's a response from Apache httpd server.
>> If so, what happens if you connect directly to the Geronimo server?
>>
>> Jarek
>>
>> On Fri, Apr 4, 2008 at 3:17 PM, Bill Brown  
>> <wb...@colorfulsoftware.com>
>> wrote:
>>>
>>>  Greetings:
>>>
>>>  I also want to note that I am using the latest Geronimo 2.1  
>>> release and
>>> have
>>>  added starting the server with "-Dfile.encoding=UTF-8" but that  
>>> doesn't
>>> seem
>>>  to help.
>>>
>>>  Thanks for any insight or input for this issue.
>>>
>>>  Bill.
>>>
>>>
>>>
>>>
>>>  Bill Brown wrote:
>>>>
>>>> Greetings:
>>>>
>>>> I am checking the standards compliance for some of my jsp pages  
>>>> that
>>>> render as XHTML.  I have run into the issue where my jsp file is
>>> encoded
>>>> as UTF-8 (according to the eclipse editor) and it includes the <? 
>>>> xml
>>>> version="1.0" encoding="UTF-8"?> at the top of the file.  However
>>> Firefox
>>>> / IE6 and the validator site are reporting that the http-header for
>>>> encoding being sent is ISO-8859-1 and so the page breaks for that
>>>> validation.  Here is the response header:
>>>>
>>>> Date: Fri, 04 Apr 2008 18:43:47 GMT
>>>> Server: Apache/2.2.4 (Ubuntu) DAV/2 SVN/1.4.4 mod_jk/1.2.23
>>> mod_ssl/2.2.4
>>>> OpenSSL/0.9.8e
>>>> Vary: Accept-Encoding
>>>> Content-Encoding: gzip
>>>> Content-Type: text/html;charset=ISO-8859-1
>>>> Via: 1.1 127.0.0.1
>>>> Keep-Alive: timeout=15, max=100
>>>> Connection: Keep-Alive
>>>> Transfer-Encoding: chunked
>>>>
>>>> Is there a setting somewhere in geronimo I can use to set the
>>> Content-Type
>>>> header to UTF-8 ?
>>>>
>>>> Thanks for your feedback.
>>>> Bill.
>>>>
>>>>
>>>
>>>  --
>>>  View this message in context:
>>> http://www.nabble.com/JSP-Charset-encoding-issue- 
>>> tp16495245s134p16496129.html
>>>
>>>
>>> Sent from the Apache Geronimo - Users mailing list archive at  
>>> Nabble.com.
>>>
>>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/JSP-Charset- 
> encoding-issue-tp16495245s134p16508391.html
> Sent from the Apache Geronimo - Users mailing list archive at  
> Nabble.com.
>




-- 
View this message in context: http://www.nabble.com/JSP-Charset-encoding-issue-tp16495245s134p16519884.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: JSP Charset encoding issue

Posted by David Jencks <da...@yahoo.com>.
This area is pretty much a mystery wrapped in an enigma to me, but I  
found
http://www.w3.org/International/O-HTTP-charset
which indicates jsps should set the charset using a page directive

<%@ page contentType="text/html; charset=UTF-8" %>

Do you have some indication that just setting the xml content  
encoding should affect the http header charset?

thanks
david jencks


On Apr 4, 2008, at 6:05 PM, Bill Brown wrote:

>
> Greetings Jarek:
>
> I tried your recommendation and it looks like the embedded tomcat in
> geronimo is also giving the same ISO-8859-1 header response.  Here  
> is what I
> have without apache in front:
>
> Server: Apache-Coyote/1.1
> Content-Type: text/html;charset=ISO-8859-1
> Transfer-Encoding: chunked
> Date: Sat, 05 Apr 2008 01:01:49 GMT
>
> 200 OK
>
> Do you think there is some configuration I can do to the embedded  
> tomcat
> running in geronimo?
>
> Thanks for looking at this.
> Bill.
>
>
>
> Jarek Gawor-2 wrote:
>>
>> Is your Geronimo server running behind Apache httpd server? The
>> "server" header looks like it's a response from Apache httpd server.
>> If so, what happens if you connect directly to the Geronimo server?
>>
>> Jarek
>>
>> On Fri, Apr 4, 2008 at 3:17 PM, Bill Brown  
>> <wb...@colorfulsoftware.com>
>> wrote:
>>>
>>>  Greetings:
>>>
>>>  I also want to note that I am using the latest Geronimo 2.1  
>>> release and
>>> have
>>>  added starting the server with "-Dfile.encoding=UTF-8" but that  
>>> doesn't
>>> seem
>>>  to help.
>>>
>>>  Thanks for any insight or input for this issue.
>>>
>>>  Bill.
>>>
>>>
>>>
>>>
>>>  Bill Brown wrote:
>>>>
>>>> Greetings:
>>>>
>>>> I am checking the standards compliance for some of my jsp pages  
>>>> that
>>>> render as XHTML.  I have run into the issue where my jsp file is
>>> encoded
>>>> as UTF-8 (according to the eclipse editor) and it includes the <? 
>>>> xml
>>>> version="1.0" encoding="UTF-8"?> at the top of the file.  However
>>> Firefox
>>>> / IE6 and the validator site are reporting that the http-header for
>>>> encoding being sent is ISO-8859-1 and so the page breaks for that
>>>> validation.  Here is the response header:
>>>>
>>>> Date: Fri, 04 Apr 2008 18:43:47 GMT
>>>> Server: Apache/2.2.4 (Ubuntu) DAV/2 SVN/1.4.4 mod_jk/1.2.23
>>> mod_ssl/2.2.4
>>>> OpenSSL/0.9.8e
>>>> Vary: Accept-Encoding
>>>> Content-Encoding: gzip
>>>> Content-Type: text/html;charset=ISO-8859-1
>>>> Via: 1.1 127.0.0.1
>>>> Keep-Alive: timeout=15, max=100
>>>> Connection: Keep-Alive
>>>> Transfer-Encoding: chunked
>>>>
>>>> Is there a setting somewhere in geronimo I can use to set the
>>> Content-Type
>>>> header to UTF-8 ?
>>>>
>>>> Thanks for your feedback.
>>>> Bill.
>>>>
>>>>
>>>
>>>  --
>>>  View this message in context:
>>> http://www.nabble.com/JSP-Charset-encoding-issue- 
>>> tp16495245s134p16496129.html
>>>
>>>
>>> Sent from the Apache Geronimo - Users mailing list archive at  
>>> Nabble.com.
>>>
>>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/JSP-Charset- 
> encoding-issue-tp16495245s134p16508391.html
> Sent from the Apache Geronimo - Users mailing list archive at  
> Nabble.com.
>


Re: JSP Charset encoding issue

Posted by Bill Brown <wb...@colorfulsoftware.com>.
Greetings Jarek: 

I tried your recommendation and it looks like the embedded tomcat in
geronimo is also giving the same ISO-8859-1 header response.  Here is what I
have without apache in front:

Server: Apache-Coyote/1.1
Content-Type: text/html;charset=ISO-8859-1
Transfer-Encoding: chunked
Date: Sat, 05 Apr 2008 01:01:49 GMT

200 OK

Do you think there is some configuration I can do to the embedded tomcat
running in geronimo? 

Thanks for looking at this.
Bill.



Jarek Gawor-2 wrote:
> 
> Is your Geronimo server running behind Apache httpd server? The
> "server" header looks like it's a response from Apache httpd server.
> If so, what happens if you connect directly to the Geronimo server?
> 
> Jarek
> 
> On Fri, Apr 4, 2008 at 3:17 PM, Bill Brown <wb...@colorfulsoftware.com>
> wrote:
>>
>>  Greetings:
>>
>>  I also want to note that I am using the latest Geronimo 2.1 release and
>> have
>>  added starting the server with "-Dfile.encoding=UTF-8" but that doesn't
>> seem
>>  to help.
>>
>>  Thanks for any insight or input for this issue.
>>
>>  Bill.
>>
>>
>>
>>
>>  Bill Brown wrote:
>>  >
>>  > Greetings:
>>  >
>>  > I am checking the standards compliance for some of my jsp pages that
>>  > render as XHTML.  I have run into the issue where my jsp file is
>> encoded
>>  > as UTF-8 (according to the eclipse editor) and it includes the <?xml
>>  > version="1.0" encoding="UTF-8"?> at the top of the file.  However
>> Firefox
>>  > / IE6 and the validator site are reporting that the http-header for
>>  > encoding being sent is ISO-8859-1 and so the page breaks for that
>>  > validation.  Here is the response header:
>>  >
>>  > Date: Fri, 04 Apr 2008 18:43:47 GMT
>>  > Server: Apache/2.2.4 (Ubuntu) DAV/2 SVN/1.4.4 mod_jk/1.2.23
>> mod_ssl/2.2.4
>>  > OpenSSL/0.9.8e
>>  > Vary: Accept-Encoding
>>  > Content-Encoding: gzip
>>  > Content-Type: text/html;charset=ISO-8859-1
>>  > Via: 1.1 127.0.0.1
>>  > Keep-Alive: timeout=15, max=100
>>  > Connection: Keep-Alive
>>  > Transfer-Encoding: chunked
>>  >
>>  > Is there a setting somewhere in geronimo I can use to set the
>> Content-Type
>>  > header to UTF-8 ?
>>  >
>>  > Thanks for your feedback.
>>  > Bill.
>>  >
>>  >
>>
>>  --
>>  View this message in context:
>> http://www.nabble.com/JSP-Charset-encoding-issue-tp16495245s134p16496129.html
>>
>>
>> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/JSP-Charset-encoding-issue-tp16495245s134p16508391.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: JSP Charset encoding issue

Posted by Jarek Gawor <jg...@gmail.com>.
Is your Geronimo server running behind Apache httpd server? The
"server" header looks like it's a response from Apache httpd server.
If so, what happens if you connect directly to the Geronimo server?

Jarek

On Fri, Apr 4, 2008 at 3:17 PM, Bill Brown <wb...@colorfulsoftware.com> wrote:
>
>  Greetings:
>
>  I also want to note that I am using the latest Geronimo 2.1 release and have
>  added starting the server with "-Dfile.encoding=UTF-8" but that doesn't seem
>  to help.
>
>  Thanks for any insight or input for this issue.
>
>  Bill.
>
>
>
>
>  Bill Brown wrote:
>  >
>  > Greetings:
>  >
>  > I am checking the standards compliance for some of my jsp pages that
>  > render as XHTML.  I have run into the issue where my jsp file is encoded
>  > as UTF-8 (according to the eclipse editor) and it includes the <?xml
>  > version="1.0" encoding="UTF-8"?> at the top of the file.  However Firefox
>  > / IE6 and the validator site are reporting that the http-header for
>  > encoding being sent is ISO-8859-1 and so the page breaks for that
>  > validation.  Here is the response header:
>  >
>  > Date: Fri, 04 Apr 2008 18:43:47 GMT
>  > Server: Apache/2.2.4 (Ubuntu) DAV/2 SVN/1.4.4 mod_jk/1.2.23 mod_ssl/2.2.4
>  > OpenSSL/0.9.8e
>  > Vary: Accept-Encoding
>  > Content-Encoding: gzip
>  > Content-Type: text/html;charset=ISO-8859-1
>  > Via: 1.1 127.0.0.1
>  > Keep-Alive: timeout=15, max=100
>  > Connection: Keep-Alive
>  > Transfer-Encoding: chunked
>  >
>  > Is there a setting somewhere in geronimo I can use to set the Content-Type
>  > header to UTF-8 ?
>  >
>  > Thanks for your feedback.
>  > Bill.
>  >
>  >
>
>  --
>  View this message in context: http://www.nabble.com/JSP-Charset-encoding-issue-tp16495245s134p16496129.html
>
>
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>

Re: JSP Charset encoding issue

Posted by Bill Brown <wb...@colorfulsoftware.com>.
Greetings: 

I also want to note that I am using the latest Geronimo 2.1 release and have
added starting the server with "-Dfile.encoding=UTF-8" but that doesn't seem
to help. 

Thanks for any insight or input for this issue. 

Bill. 


Bill Brown wrote:
> 
> Greetings: 
> 
> I am checking the standards compliance for some of my jsp pages that
> render as XHTML.  I have run into the issue where my jsp file is encoded
> as UTF-8 (according to the eclipse editor) and it includes the <?xml
> version="1.0" encoding="UTF-8"?> at the top of the file.  However Firefox
> / IE6 and the validator site are reporting that the http-header for
> encoding being sent is ISO-8859-1 and so the page breaks for that
> validation.  Here is the response header: 
> 
> Date: Fri, 04 Apr 2008 18:43:47 GMT
> Server: Apache/2.2.4 (Ubuntu) DAV/2 SVN/1.4.4 mod_jk/1.2.23 mod_ssl/2.2.4
> OpenSSL/0.9.8e
> Vary: Accept-Encoding
> Content-Encoding: gzip
> Content-Type: text/html;charset=ISO-8859-1
> Via: 1.1 127.0.0.1
> Keep-Alive: timeout=15, max=100
> Connection: Keep-Alive
> Transfer-Encoding: chunked
> 
> Is there a setting somewhere in geronimo I can use to set the Content-Type
> header to UTF-8 ? 
> 
> Thanks for your feedback.  
> Bill. 
> 
> 

-- 
View this message in context: http://www.nabble.com/JSP-Charset-encoding-issue-tp16495245s134p16496129.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.