tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guy <...@polylab.sfu.ca>
Subject Re: Content-Type: text/vnd.wap.wml
Date Fri, 01 Dec 2000 19:37:15 GMT
Sorry for the typo, I actually have
response.setContentType("text/vnd.wap.xml");  in my code.
I put it right after the doGet but I get the output shown below with two
Content-Types.?
I would like to upgrade to Tomcat 3.2 but my 'root user' is not available for some
time. Perhaps that would solve the problem?

Thanks for your help
Guy

"Craig R. McClanahan" wrote:

> guy wrote:
>
> > I am running a servlet(on Tomcat 3.1beta) (that uses XT and an XSLT
> > stylesheet to convert data to WML). When I try to affect the output
> > header with
> > response.setContentType("text,vnd.wap.xml"), my output contains:
> > HTTP/1.0 200 OK
> > Content-Type: text/vnd.wap.wml
> > Content-Type: application/xml
> >
> > which doesn't work.
> > (Is the XT servlet outputing its default content after my servlet
> > outputs
> > what I want?Or does Tomcat set it?)
> > How do I get the desired results? ie. only:
> >
> > HTTP/1.0 200 OK
> > Content-Type: text/vnd.wap.wml
> >
>
> That's actually pretty easy.  If you want
>
>     Content-Type: text/vnd.wap.wml
>
> then you should call
>
>     response.setContentType("text/vnd.wap.xml");
>
> instead of
>
>     response.setContentType("text,vnd.wap.xml");
>
> Note that, to be effective, you must call response.setContentType() *before*
> your response has been commited (that is, before the first buffer is flushed).
> I make sure this happens in my code by setting the content type before calling
> response.getWriter().
>
> Also, you really should update to Tomcat 3.2 -- there have been huge numbers of
> bug fixes (plus better performance to boot).
>
> >
> > Thanks
> > Guy
> >
>
> Craig McClanahan


Mime
View raw message