tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Farquhar <sc...@atlassian.com>
Subject OutputStreams, Writers and Sitemesh
Date Mon, 02 Feb 2004 04:26:43 GMT
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


Mime
View raw message