>>>>> I have a filter that I wrote to scoop the output of a JSP and save
>>>>> it to a file. It worked fine in Tomcat 4.x, but in Tomcat 5.5 it
[quoted text clipped - 50 lines]
> output buffer at the end of the JSP and then pad it out to the full
> length of the buffer, but that seems like an incredible kludge.
An update -- it seems like dynamically padding isn't possible -- I don't
see any way to read the size of the written content. But, If I pad the
end of the page with 8192-plus spaces, it "works". So it seems to be
ignoring my buffer size request in the JSP and doing it in 8kb chunks.
If I force the last real content to fill a chunk, that gets written, and
the content gets cut off somewhere in the middle of my padding.
BTW, I'm not sure if I understand your question "What function does the
filter chain do here?" If you mean what is the application, I'm sending
a dynamic page and saving a copy of what was sent.
Matt Humphrey - 12 Jun 2006 19:47 GMT
> An update -- it seems like dynamically padding isn't possible -- I don't
> see any way to read the size of the written content. But, If I pad the
> end of the page with 8192-plus spaces, it "works". So it seems to be
> ignoring my buffer size request in the JSP and doing it in 8kb chunks. If
> I force the last real content to fill a chunk, that gets written, and the
> content gets cut off somewhere in the middle of my padding.
The content-length header isn't always correct because it's sent before the
actual content is sent.. I'm thinking that Tomcat 4.x did the right thing
and looked at the actual size of the content, whereas 5.5 is looking at the
declared buffer size or the content header
> BTW, I'm not sure if I understand your question "What function does the
> filter chain do here?" If you mean what is the application, I'm sending a
> dynamic page and saving a copy of what was sent.
I was just wondering if the filter chain could be interfering with the read
/ write operation--I'm unfamiliar with them. I can't think of anything else
and I'm too unfamiliar with the nuances of Tomcat.
Good luck,
Matt Humphrey matth@ivizNOSPAM.com http://www.iviz.com/