tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Danno Ferrin" <DFER...@novell.com>
Subject PATCH: SingleThreadModel ignored in JSP pages
Date Thu, 09 Dec 1999 01:53:44 GMT
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
===================================================================
RCS file: /home/cvspublic/jakarta-tomcat/src/share/org/apache/jasper/runtime/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;
! 
!                 theServlet.service(request, response);
              } catch (FileNotFoundException ex) {
                  response.sendError(HttpServletResponse.SC_NOT_FOUND, 
                                     Constants.getString("jsp.error.file.not.found", 
--- 149,165 ----
  		// If a page is to only to be precompiled return.
  		if (precompile)
  		    return;
! 		    
!                 // 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) { 
! 			theServlet.service(request, response);
! 	            }
! 		} else {
! 		    theServlet.service(request, response);
! 		}
              } catch (FileNotFoundException ex) {
                  response.sendError(HttpServletResponse.SC_NOT_FOUND, 
                                     Constants.getString("jsp.error.file.not.found", 



Mime
View raw message