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 61581 invoked from network); 24 Jul 2000 17:28:57 -0000 Received: from lukla.sun.com (192.18.98.31) by locus.apache.org with SMTP; 24 Jul 2000 17:28:57 -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 LAA26398 for ; Mon, 24 Jul 2000 11:28:55 -0600 (MDT) 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 LAA12677 for ; Mon, 24 Jul 2000 11:28:55 -0600 (MDT) Received: from eng.sun.com by esun1as-mm. (SMI-8.6/SMI-SVR4) id LAA06443; Mon, 24 Jul 2000 11:31:11 -0600 Message-ID: <397C7CF5.E103137B@eng.sun.com> Date: Mon, 24 Jul 2000 10:29:25 -0700 From: "Craig R. McClanahan" X-Mailer: Mozilla 4.72 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: tomcat-user@jakarta.apache.org Subject: Re: Doing multiple getOutputStream( ) commands. References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Paul_Craven@nas.adp.com wrote: > I have a servlet that outputs some html, then calls RequestDispatcher to > include another file. This doesn't work with Tomcat, because Tomcat throws > an exception that outputStream is already in use. > > I don't see anything in the specs that says I can't do what I am trying. > The specs say that, if you used the output stream in the "outer" servlet or JSP page, then you can only use the output stream (and not the writer) in the "included" servlet or JSP page. Likewise, if the outer servlet uses the writer, then the included servlet can only use the writer. Tomcat is correctly implementing these spec requirements. You need to choose one or the other output method in your application (the general rule to follow is "use the writer if you are writing text, use the output stream if you are writing binary"). > > Thanks, > > Paul Vincent Craven > Quality Consulting, Inc. Craig McClanahan