"renen" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi Folks,
>
> I want to tell the browser / Tomcat that I'm done processing my JSP page
> (ie, the little spinning icon in Firefox should stop spinning!).
>
> However, I still want to log a couple of things (duration, browser info
> etc). But, the users' browser doesn't need to be tied up while this 
> happens.
>
> One way to do that would seem to be to call response.flush(). However,
> Tomcat seems to have issues with this (google: response.flush tomcat).
> Indeed, it doesn't seem to do anything at all.
>
> The one way I did manage to communicate that I was done was to call:
>
> response.getWriter().flush();
> response.getWriter().close();
>
> But, on certain (tiny) pages, it seems to kill all the content. Which is a
> bit unfortunate!
>
> Is there a way that I can signal to Tomcat / the browser / the servlet
> filters, that my JSP page is done?
>

<% out.close(); %>

The problem is that your page is writing to the JspWriter implicit object 
"out", which on the page below is buffering the first 8Kb (the default 
value) of the page before sending it to the request.getWriter().  So when 
you close request.getWriter(), you prevent the JspWriter from sending it's 
buffered output.  Also note, that you have to make certain that there are no 
characters in the file (not even a newline) after the expression <% 
out.close() %>, or you will start filling up your logs with IOExceptions.

This will tell Tomcat to tell the browser that this is all the output it 
will receive.  Unless you are doing fancy Response wrapping, your Filters 
will find out that you are done in the usual way when you fall off the end 
of the page.



>
> The page that doesn't render when those two lines of code are included is 
> as
> follows:
>
> <%@ page language="java" import="za.co.oneTwoOne.web.*"
> pageEncoding="ISO-8859-1"%>
> <%
> Session myPage = new Session(request, response);
> pageContext.setAttribute("myPage", myPage);
> %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
>  <body>
>    ProcessID <%=myPage.getParameter("ProcessID") %> took
> <%=myPage.getInt("exec ProcessGetExecutionTime ?", "ProcessID*") %> ms to
> serve.
>  </body>
> </html>
>
> <%
> myPage.terminate();
> %>
>
>
> I really appreciate your input!
>
> Renen.
>
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> 




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to