tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: serializing XML to a ServletOutputStream fails
Date Mon, 05 Feb 2001 19:47:43 GMT
Michael Mealling wrote:

> On Mon, Feb 05, 2001 at 08:17:57PM +0900, Takashi Okamoto wrote:
> > From: "Michael Mealling" <michael@bailey.dscga.com>
> > To: <tomcat-dev@jakarta.apache.org>
> > Cc: <michaelm@netsol.com>
> > Sent: Monday, February 05, 2001 7:54 PM
> > Subject: Re: serializing XML to a ServletOutputStream fails
> >
> > > P.S. I've also posted this problem to HotDispatch so if you
> > > can help me solve the problem you could get $50... ;-)
> >
> > >        response.setContentType("text/xml; charset=UTF-8");
> >
> > Could you try following code instead of this?
> >
> >        response.setContentType("text/xml; charset=8859_1");
>
> Sure. Same thing. It appears that I get the same output
> regardless of what I set the content type to...
>

That is because you are using an output stream, which is just a stream of
uninterpreted bytes from the viewpoint of the servlet container.  Setting the
content type with a character encoding, as described above, will affect the Writer
that is returned by response.getWriter() -- as long as you call setContentType()
first.

>
> -MM
>

Craig McClanahan



Mime
View raw message