tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Yates" <yate...@nortelnetworks.com>
Subject Tomcat 4.1.24 Servlet connection:close
Date Tue, 15 Apr 2003 02:14:48 GMT
Hi all,

I am using Tomcat 4.1.24 on Solaris 8 with JDK 1.4.1_01
I was wondering whether anyone has had any success in forcing the socket to
close from a servlet by doing code like the following:

public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
  // do normal servlet processing to get a result

  response.setHeader("Connection","close");            
  
  PrintWriter out = response.getWriter();
  out.print(result.getResultString());

  out.flush();
}

I don't want to force the connection closed on every request (only when
something goes wrong in my back end processing). However running netstat on
my Solaris box whilst making requests shows that the connection never
closes. It just keeps on getting reused regardless of whether I specify
Connection: close in the response header or not.

Any help appreciated.

Michael


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message