Well not sure what to tell you about your particular issue, but I experienced a very 
similar problem (double page, or at least partial double page).  In a JSP page 
something like this:

        <%@ include file="header.jsp" %>

        <%
                // check login
                if (!user.loggedIn()) {
                        response.sendRedirect("login.jsp");
                        return;
                }
        %>

The problem is that the response content is sent along with the response headers.  I 
think this is appropriate, but produces undesirable results in IE (double page).  The 
solution was to be sure that any redirects were sent and the method returned before 
any HTML was added to the response, like this:

        <%
                // check login do this before sending any HTML to response
                if (!user.loggedIn()) {
                        response.sendRedirect("login.jsp");
                        return;
                }
        %>

        <!-- now HTML is fine -->
        <%@ include file="header.jsp" %>


I'm not sure but I think that a call to reponse.close() will flush anything left in 
the buffer then close.  The fact that double clicking a link produces the same result 
is strange (and I've never seen that), because you would think that the first response 
never gets a chance to do anything, or just gets ignored by the browser

Hope this helps

Dave

-----Original Message-----
From: Jenya Strokin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 18, 2002 9:44 AM
To: Tomcat Users List
Subject: RE: How to close a response?


I'm using servlet. But if you know way how to do this from JSP, please share
it.))
This is my method wich called from doGet and doPost:

  public void doGetPost(HttpServletRequest request, HttpServletResponse
response)
  throws ServletException, IOException {
/*------------------------------------------------------
If user clicks link twice, browser will get the same screen two times mixed.
So, I need synchronized processes. But after that browser will get the same
screen one after another. So I need close output after I process first
request, and second request can not write to output string.
--------------------------------------------------------*/

    synchronized(request){
      abstractBean.setSharedSession(sharedSessionBean);
      abstractBean.setRequest(request);
      abstractBean.setResponse(response);
      abstractBean.setServlet(this);
      abstractBean.process();

      abstractBean.footerProcess();
//---------- I'm trying to close output here, but second process write its
data anyway
//      out.close();
      response.getWriter().close();
    }
  }

If this information is not enough, I'll provide more.
Thanks for any help.

-----Original Message-----
From: Durham David Cntr 805CSS/SCBE [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 18, 2002 10:18 AM
To: Tomcat Users List
Subject: RE: How to close a response?


Need more detail about your problem.  Are you having a problem with JSP?

-----Original Message-----
From: Jenya Strokin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 18, 2002 9:17 AM
To: [EMAIL PROTECTED]
Subject: How to close a response?


Hi,
I need to close the response completely. In some case I need to avoid any
process write to response output.
Using
response.getOutputStream().close();
response.getWriter().close();
response.reset();
do not help.
Thanks for any suggestions.

Jenya

-------------------------------------------
Introducing NetZero Long Distance
Unlimited Long Distance only $29.95/ month!
Sign Up Today! www.netzerolongdistance.com

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


-------------------------------------------
Introducing NetZero Long Distance
Unlimited Long Distance only $29.95/ month!
Sign Up Today! www.netzerolongdistance.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to