geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From de...@apache.org
Subject svn commit: r966086 [2/2] - in /geronimo/external/branches/tomcat-parent-6.0.28: catalina/src/main/java/org/apache/catalina/core/ catalina/src/main/java/org/apache/catalina/deploy/ catalina/src/main/java/org/apache/catalina/servlets/ catalina/src/main/...
Date Wed, 21 Jul 2010 05:00:09 GMT
Modified: geronimo/external/branches/tomcat-parent-6.0.28/jasper/src/main/java/org/apache/jasper/servlet/JspServletWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/external/branches/tomcat-parent-6.0.28/jasper/src/main/java/org/apache/jasper/servlet/JspServletWrapper.java?rev=966086&r1=966085&r2=966086&view=diff
==============================================================================
--- geronimo/external/branches/tomcat-parent-6.0.28/jasper/src/main/java/org/apache/jasper/servlet/JspServletWrapper.java
(original)
+++ geronimo/external/branches/tomcat-parent-6.0.28/jasper/src/main/java/org/apache/jasper/servlet/JspServletWrapper.java
Wed Jul 21 05:00:08 2010
@@ -31,7 +31,7 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.jsp.tagext.TagInfo;
 
-import org.apache.AnnotationProcessor;
+import org.apache.InstanceManager;
 import org.apache.jasper.JasperException;
 import org.apache.jasper.JspCompilationContext;
 import org.apache.jasper.Options;
@@ -39,6 +39,7 @@ import org.apache.jasper.compiler.ErrorD
 import org.apache.jasper.compiler.JavacErrorDetail;
 import org.apache.jasper.compiler.JspRuntimeContext;
 import org.apache.jasper.compiler.Localizer;
+import org.apache.jasper.runtime.InstanceManagerFactory;
 import org.apache.jasper.runtime.JspSourceDependent;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
@@ -68,7 +69,6 @@ public class JspServletWrapper {
 
     private Servlet theServlet;
     private String jspUri;
-    private Class servletClass;
     private Class tagHandlerClass;
     private JspCompilationContext ctxt;
     private long available = 0L;
@@ -139,15 +139,10 @@ public class JspServletWrapper {
                     destroy();
                     
                     Servlet servlet = null;
-                    
+
                     try {
-                        servletClass = ctxt.load();
-                        servlet = (Servlet) servletClass.newInstance();
-                        AnnotationProcessor annotationProcessor = (AnnotationProcessor) config.getServletContext().getAttribute(AnnotationProcessor.class.getName());
-                        if (annotationProcessor != null) {
-                           annotationProcessor.processAnnotations(servlet);
-                           annotationProcessor.postConstruct(servlet);
-                        }
+                        InstanceManager instanceManager = InstanceManagerFactory.getInstanceManager(config);
+                        servlet = (Servlet) instanceManager.newInstance(ctxt.getFQCN(), ctxt.getJspLoader());
                     } catch (IllegalAccessException e) {
                         throw new JasperException(e);
                     } catch (InstantiationException e) {
@@ -426,15 +421,13 @@ public class JspServletWrapper {
     public void destroy() {
         if (theServlet != null) {
             theServlet.destroy();
-            AnnotationProcessor annotationProcessor = (AnnotationProcessor) config.getServletContext().getAttribute(AnnotationProcessor.class.getName());
-            if (annotationProcessor != null) {
-                try {
-                    annotationProcessor.preDestroy(theServlet);
-                } catch (Exception e) {
-                    // Log any exception, since it can't be passed along
-                    log.error(Localizer.getMessage("jsp.error.file.not.found",
-                           e.getMessage()), e);
-                }
+            InstanceManager instanceManager = InstanceManagerFactory.getInstanceManager(config);
+            try {
+                instanceManager.destroyInstance(theServlet);
+            } catch (Exception e) {
+                // Log any exception, since it can't be passed along
+                log.error(Localizer.getMessage("jsp.error.file.not.found",
+                        e.getMessage()), e);
             }
         }
     }



Mime
View raw message