glenn 2003/02/10 08:39:00
Modified: jasper2/src/share/org/apache/jasper
JspCompilationContext.java
jasper2/src/share/org/apache/jasper/servlet
JspServletWrapper.java
Log:
Port bug fix for 16449, thread locking from Tomcat 4
Revision Changes Path
1.30 +6 -13
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java
Index: JspCompilationContext.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- JspCompilationContext.java 22 Jan 2003 20:08:23 -0000 1.29
+++ JspCompilationContext.java 10 Feb 2003 16:38:59 -0000 1.30
@@ -115,8 +115,7 @@
private JspRuntimeContext rctxt;
private int removed = 0;
- private boolean reload = true;
-
+
private URLClassLoader jspLoader;
private URL[] outUrls;
private Class servletClass;
@@ -570,7 +569,7 @@
if (isPackagedTagFile || jspCompiler.isOutDated()) {
try {
jspCompiler.compile();
- reload = true;
+ jsw.setReload(true);
} catch (JasperException ex) {
throw ex;
} catch (Exception ex) {
@@ -581,12 +580,6 @@
}
}
- /** True if the servlet needs loading
- */
- public boolean isReload() {
- return reload;
- }
-
// ==================== Manipulating the class ====================
public Class load()
@@ -616,7 +609,7 @@
ex);
}
removed = 0;
- reload = false;
+ jsw.setReload(false);
return servletClass;
}
1.26 +13 -8
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java
Index: JspServletWrapper.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- JspServletWrapper.java 22 Jan 2003 20:08:25 -0000 1.25
+++ JspServletWrapper.java 10 Feb 2003 16:38:59 -0000 1.26
@@ -122,6 +122,7 @@
private ServletConfig config;
private Options options;
private boolean firstTime = true;
+ private boolean reload = true;
private boolean isTagFile;
private int tripCount;
@@ -169,14 +170,18 @@
return ctxt;
}
+ public void setReload(boolean reload) {
+ this.reload = reload;
+ }
+
public Servlet getServlet()
throws ServletException, IOException, FileNotFoundException
{
- if (ctxt.isReload()) {
+ if (reload) {
synchronized (this) {
// Synchronizing on jsw enables simultaneous loading
// of different pages, but not the same page.
- if (ctxt.isReload()) {
+ if (reload) {
// This is to maintain the original protocol.
destroy();
@@ -215,7 +220,7 @@
ctxt.compile();
}
}
- if (ctxt.isReload()) {
+ if (reload) {
tagHandlerClass = ctxt.load();
}
} catch (FileNotFoundException ex) {
@@ -248,7 +253,7 @@
try {
Object target;
if (isTagFile) {
- if (ctxt.isReload()) {
+ if (reload) {
tagHandlerClass = ctxt.load();
}
target = tagHandlerClass.newInstance();
@@ -298,7 +303,7 @@
}
}
- if (ctxt.isReload()) {
+ if (reload) {
getServlet();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]