Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 90091 invoked from network); 2 Feb 2004 04:27:26 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 2 Feb 2004 04:27:26 -0000 Received: (qmail 86012 invoked by uid 500); 2 Feb 2004 04:26:34 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 85978 invoked by uid 500); 2 Feb 2004 04:26:33 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 85959 invoked from network); 2 Feb 2004 04:26:33 -0000 Received: from unknown (HELO zeus.atlassian.com) (64.39.31.158) by daedalus.apache.org with SMTP; 2 Feb 2004 04:26:33 -0000 Received: (from sfarquhar@localhost) by zeus.atlassian.com (8.11.6/8.11.6) id i124QhN26853; Sun, 1 Feb 2004 22:26:43 -0600 X-Authentication-Warning: zeus.atlassian.com: sfarquhar set sender to scott@atlassian.com using -f Date: Sun, 1 Feb 2004 22:26:43 -0600 From: Scott Farquhar To: tomcat-user@jakarta.apache.org Cc: dev@atlassian.com Subject: OutputStreams, Writers and Sitemesh Message-ID: <20040201222643.S9149@zeus.atlassian.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Guys, I've searched the mail archive, but couldn't find anything there - so please feel freee to point me there if this has already been answered. Sitemesh is a page decoration framework that works on all application servers, and allows you to decorate your HTML pages. The way that it works is that the page is captured in a buffer, then passed to a 'decorator', which does the decoration (using the original content as input). More information can be found here: http://www.opensymphony.com/sitemesh/ The problem comes when choosing to use getOutputStream() or getWriter() to write out the content. This is because you cannot call both in one request. My current method of doing this involves logging which of these is used by the server, and then using that to print out using either streams or writers. However, in Tomcat 4.x and later, it seems that getOutputStream() is used for serving static resources, and getWriter() is used to serve JSPs. This means that if I buffer up static content (using a PageResponseWrapper), then I can't then access a JSP using the same request. I guess that this will also affect anyone redispatching to a JSP after accessing a static resource. So - can anyone point me to a config somewhere that I can tell Tomcat to use Writers for everything? Or some other workaround? If I haven't been clear above - please let me know. Cheers, Scott --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org