Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 71086 invoked from network); 1 Dec 2000 18:32:51 -0000 Received: from lukla.sun.com (192.18.98.31) by locus.apache.org with SMTP; 1 Dec 2000 18:32:50 -0000 Received: from centralmail1.Central.Sun.COM ([129.147.62.10]) by lukla.Sun.COM (8.9.3+Sun/8.9.3) with ESMTP id LAA06648 for ; Fri, 1 Dec 2000 11:32:43 -0700 (MST) Received: from esun1as-mm. (esun1as-mm.Central.Sun.COM [129.147.34.144]) by centralmail1.Central.Sun.COM (8.9.3+Sun/8.9.3/ENSMAIL,v1.7) with SMTP id LAA18556 for ; Fri, 1 Dec 2000 11:32:43 -0700 (MST) Received: from eng.sun.com by esun1as-mm. (SMI-8.6/SMI-SVR4) id LAA11145; Fri, 1 Dec 2000 11:45:41 -0700 Message-ID: <3A27EF20.9F5CD3DC@eng.sun.com> Date: Fri, 01 Dec 2000 10:34:08 -0800 From: "Craig R. McClanahan" X-Mailer: Mozilla 4.75 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: tomcat-user@jakarta.apache.org Subject: Re: Content-Type: text/vnd.wap.wml References: <3A272A1D.82080463@polylab.sfu.ca> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N 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