tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Costin Manolache <cmanola...@yahoo.com>
Subject Re: jasper questions
Date Thu, 24 Oct 2002 17:31:01 GMT
Any opinions ? 

This is a significant change - I won't do it unless I have some feedback.

The issues is moving flush() out of PageContextImpl.release() and into
the generated java code, just before calling releasePageContext().

My assertion is that release() shouldn't have the flush() as side effect.

There is one major problem - doing a flush() is not enough to enable
the Content-Length generation for JSPs, we need to either close() or 
let the data in the buffer so that the servlet wrapper will do the
flush-and-close operation.

The jsp page can be included - but I think close is disabled in included,
so it won't affect anything. 

If we let the servlet wrapper deal with it - then we need a 'partial flush'
in release() - which will just move the data to the parent buffer ( 
OutputBuffer from what I see ), but without calling flush on it.

Remy, what do you think ?

Costin 

Costin Manolache wrote:

> I'm trying to understand the last part of the JSP execution - and
> how the buffer is flushed and closed.
> 
> Acording to javadocs, JspFactory.releasePageContext() should
> be invoked, and that will call PageContext.release().
> 
> In release() javadoc:
> 
>     * This method shall "reset" the internal state of a PageContext,
> releasing
>      * all internal references, and preparing the PageContext for
>      potential * reuse by a later invocation of initialize(). This method
>      is typically * called from JspFactory.releasePageContext().
> 
> 
> There is no mention that this method will flush the buffers as
> side effect. At least that's my reading.
> 
> I think a more correct implementation would be to call
> out.flush()/out.close() explicitely and then call release().
> 
> The benefit would be that the connector will be able to
> automatically add Content-Length ( at least for small pages ),
> and that's usually good for performance or when talking with
> certain clients. ( that's what coyote does for servlets - but
> not for JSPs since flush() is called too early ).
> 

-- 
Costin



--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message