cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r648145 - /cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java
Date Tue, 15 Apr 2008 07:40:23 GMT
Author: reinhard
Date: Tue Apr 15 00:40:21 2008
New Revision: 648145

URL: http://svn.apache.org/viewvc?rev=648145&view=rev
Log:
lazy initialization
(... have to figure out why an advice around the init() method on servlets doesn't work as
expected)

Modified:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java?rev=648145&r1=648144&r2=648145&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java
Tue Apr 15 00:40:21 2008
@@ -63,6 +63,8 @@
      */
     private static final String PARAM_PASS_THROUGH = "pass-through";
 
+    private boolean initialized;
+
 
     protected RequestProcessor processor;
 
@@ -72,7 +74,6 @@
      */
     public void init() throws ServletException {
         super.init();
-        this.processor = new RequestProcessor(getServletContext());
     }
 
     /**
@@ -80,6 +81,10 @@
      */
     protected void service(HttpServletRequest request, HttpServletResponse response)
     throws ServletException, IOException {
+        if (!initialized) {
+            this.processor = new RequestProcessor(getServletContext());
+            initialized = true;
+        }
 
         this.processor.service(request, response);
     }



Mime
View raw message