Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 6554 invoked from network); 9 Dec 1999 01:54:21 -0000 Received: from prv-mail20.provo.novell.com (137.65.82.195) by 63.211.145.10 with SMTP; 9 Dec 1999 01:54:21 -0000 Received: from INET-PRV-Message_Server by prv-mail20.provo.novell.com with Novell_GroupWise; Wed, 08 Dec 1999 18:53:53 -0700 Message-Id: X-Mailer: Novell GroupWise Internet Agent 5.5.2.1 Date: Wed, 08 Dec 1999 18:53:44 -0700 From: "Danno Ferrin" To: Subject: PATCH: SingleThreadModel ignored in JSP pages Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline This is the same solution used in tomcat core. A more involved solution = would be to use a pool of the thread unsafe servlets, but then it would = need to be configureable and it would be best to factory out the JspWrapper= code. Tomcat core doesn't pool so that wouldn't work well here. Index: src/share/org/apache/jasper/runtime/JspServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvspublic/jakarta-tomcat/src/share/org/apache/jasper/runtim= e/JspServlet.java,v retrieving revision 1.10 diff -C3 -r1.10 JspServlet.java *** JspServlet.java 1999/11/13 00:32:52 1.10 --- JspServlet.java 1999/12/09 01:51:20 *************** *** 149,156 **** // If a page is to only to be precompiled return. if (precompile) return; !=20 ! theServlet.service(request, response); } catch (FileNotFoundException ex) { response.sendError(HttpServletResponse.SC_NOT_FOUND,=20 Constants.getString("jsp.error.file.no= t.found",=20 --- 149,165 ---- // If a page is to only to be precompiled return. if (precompile) return; ! =20 ! // not the best solution, but technically accurate ! if (theServlet instanceof javax.servlet.SingleThreadModel) = { ! // sync on the wrapper so that the freshness ! // of the page is determined right before servicing ! synchronized(this) {=20 ! theServlet.service(request, response); ! } ! } else { ! theServlet.service(request, response); ! } } catch (FileNotFoundException ex) { response.sendError(HttpServletResponse.SC_NOT_FOUND,=20 Constants.getString("jsp.error.file.no= t.found",=20