You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jan Normann Nielsen <li...@dubbekarl.dk> on 2006/11/21 12:03:41 UTC

Tapestry output changes from Tomcat to JBoss

Hello

I've tried two forums, but noone has had an answer. Now I try this 
mailing list instead.

I'm experiencing a strange problem. When deploying my Tapestry 4 
application directly in Tomcat 5.5.20, it runs perfectly, and my 
localized messages (rendered using <span key="...">) are output as UTF-8 
strings, and the HTTP response headers and <meta> HTML headers says that 
the content type is "text/html;charset=UTF-8". So far, so good.

BUT, when I fire up my JBoss 4.0.5GA which has an embedded Tomcat 5.5.20 
and I deploy my Tapestry application, the localized messages suddenly 
render as iso-8859-1 but the HTTP response headers and <meta> HTML 
headers still tell the same content type, namely UTF-8. This means that 
all non-ascii characters show up as ? in my browser because my 
iso-8859-1 output is parsed as UTF-8 by the browser.

Do anyone have any past experiences on what causes my problem? Do anyone 
have a solution?

Best wishes,
Jan Nielsen

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Re: Tapestry output changes from Tomcat to JBoss

Posted by Sam Gendler <sg...@ideasculptor.com>.
I'll second that solution.  Unless you tell the VM what the default
file encoding should be, you have to explicitly tell every single
stream you read or write data from that it should use UTF-8 encoding,
assuming that UTF-8 isn't the default encoding on your system.  I have
found that the default varies from OS to OS (and possibly container to
container).  Easy to test.  Just build a class which puts the value of
Charset.defaultCharset() somewhere in your page.  My guess is that
you'll see a different value between the two different servers.
Setting it explicitly via the file.encoding system property should fix
it.

--sam


On 11/21/06, Lukas Ruetz <lu...@gmx.at> wrote:
> Hi!
>
> I had to add the VM option '-Dfile.encoding=utf-8' when starting tomcat to
> get utf-8 output working. Maybe you can start JBoss with that option or
> configure JBoss to run tomcat with that option.
>
> hth
> lukas
>
> Am Dienstag, 21. November 2006 12:03 schrieb Jan Normann Nielsen:
> > Hello
> >
> > I've tried two forums, but noone has had an answer. Now I try this
> > mailing list instead.
> >
> > I'm experiencing a strange problem. When deploying my Tapestry 4
> > application directly in Tomcat 5.5.20, it runs perfectly, and my
> > localized messages (rendered using <span key="...">) are output as UTF-8
> > strings, and the HTTP response headers and <meta> HTML headers says that
> > the content type is "text/html;charset=UTF-8". So far, so good.
> >
> > BUT, when I fire up my JBoss 4.0.5GA which has an embedded Tomcat 5.5.20
> > and I deploy my Tapestry application, the localized messages suddenly
> > render as iso-8859-1 but the HTTP response headers and <meta> HTML
> > headers still tell the same content type, namely UTF-8. This means that
> > all non-ascii characters show up as ? in my browser because my
> > iso-8859-1 output is parsed as UTF-8 by the browser.
> >
> > Do anyone have any past experiences on what causes my problem? Do anyone
> > have a solution?
> >
> > Best wishes,
> > Jan Nielsen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry output changes from Tomcat to JBoss

Posted by Lukas Ruetz <lu...@gmx.at>.
Hi!

I had to add the VM option '-Dfile.encoding=utf-8' when starting tomcat to
get utf-8 output working. Maybe you can start JBoss with that option or
configure JBoss to run tomcat with that option.

hth
lukas

Am Dienstag, 21. November 2006 12:03 schrieb Jan Normann Nielsen:
> Hello
>
> I've tried two forums, but noone has had an answer. Now I try this
> mailing list instead.
>
> I'm experiencing a strange problem. When deploying my Tapestry 4
> application directly in Tomcat 5.5.20, it runs perfectly, and my
> localized messages (rendered using <span key="...">) are output as UTF-8
> strings, and the HTTP response headers and <meta> HTML headers says that
> the content type is "text/html;charset=UTF-8". So far, so good.
>
> BUT, when I fire up my JBoss 4.0.5GA which has an embedded Tomcat 5.5.20
> and I deploy my Tapestry application, the localized messages suddenly
> render as iso-8859-1 but the HTTP response headers and <meta> HTML
> headers still tell the same content type, namely UTF-8. This means that
> all non-ascii characters show up as ? in my browser because my
> iso-8859-1 output is parsed as UTF-8 by the browser.
>
> Do anyone have any past experiences on what causes my problem? Do anyone
> have a solution?
>
> Best wishes,
> Jan Nielsen

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org