Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

Re: On Tomcat 5.5.9, can't flush the buffer or reduce buffer size
< 8192

Tim Funk

2006-12-19

Replies:

You can't mix page directives with snippets. Page directives occur at
page translation time (before the compilation process)

To eliminate buffering - try
<%@(protected)'%>


-Tim

Richard Mundell wrote:
> Thanks Tim.
>
> out.flush() wasn't doing anything unless there was already 8KB in the
> buffer.
>
> But, the JSP page directive helped:
>
> Before setting the JSP page directive, the pre-compiled .java file that
> Tomcat was creating had...
>
>     pageContext = _jspxFactory.getPageContext(this, request, response,
>          "ErrorPage.jsp", true, 8192, true);
>
> ...and now, with <%@(protected)...
>
>     pageContext = _jspxFactory.getPageContext(this, request, response,
>          "ErrorPage.jsp", true, 1024, true);
>
> It looks like the buffer can only be specified in 1kb increments, but a 1KB
> keep-alive being sent every 30 seconds is better than an 8KB keep-alive.
>
> Is there a way to make the JSP page directive conditional?
>
> Basically, I only want to set the buffer to 1KB for certain users of my
> application.
>
> I tried...
>
>  <%
>  if (useSmallBuffer==true) {
>    %><%@(protected)"%><%
>  }
>  %>
>
> ...but this doesn't work (can't mix directives and scripting elements).
>
> Any ideas?
>
> Thanks,
>
> Richard
>
>
>
>
>
> -----Original Message-----
> From: Tim Funk [mailto:funkman@(protected)]
> Sent: Tuesday, December 19, 2006 6:53 AM
> To: Tomcat Users List
> Subject: Re: On Tomcat 5.5.9, can't flush the buffer or reduce buffer size <
> 8192
>
> JSP's also have a buffer too. To make it smaller or eliminate it:
>
> <%@(protected)'%>
> or use out.flush() instead or response.flushBuffer()
>
> -Tim
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.