cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gkossakow...@apache.org
Subject svn commit: r686261 - in /cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src: changes/ main/java/org/apache/cocoon/servletservice/spring/
Date Fri, 15 Aug 2008 15:52:31 GMT
Author: gkossakowski
Date: Fri Aug 15 08:52:30 2008
New Revision: 686261

URL: http://svn.apache.org/viewvc?rev=686261&view=rev
Log:
<action dev="gkossakowski" type="fix" issue="COCOON-2236">
  ServletFactoryBean will install JNet handlers before calling init() method
  of Servlet that is being created. This should make SSF compatible with Cocoon Core 2.2.0
again.
</action>

Modified:
    cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/changes/changes.xml
    cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletDecorator.java
    cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletFactoryBean.java

Modified: cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/changes/changes.xml?rev=686261&r1=686260&r2=686261&view=diff
==============================================================================
--- cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/changes/changes.xml
(original)
+++ cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/changes/changes.xml
Fri Aug 15 08:52:30 2008
@@ -29,6 +29,10 @@
         Fixed HttpServletResponseBufferingWrapper implementation so it does not throw IllegalStateException
         when resestBufferedResponse is being called.
       </action>
+      <action dev="gkossakowski" type="fix" issue="COCOON-2236">
+        ServletFactoryBean will install JNet handlers before calling init() method
+        of Servlet that is being created. This should make SSF compatible with Cocoon Core
2.2.0 again.
+      </action>
     </release>
     <release version="1.1.0" date="2008-08-09" description="released">
       <action dev="reinhard" type="fix">

Modified: cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletDecorator.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletDecorator.java?rev=686261&r1=686260&r2=686261&view=diff
==============================================================================
--- cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletDecorator.java
(original)
+++ cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletDecorator.java
Fri Aug 15 08:52:30 2008
@@ -82,6 +82,9 @@
         servletFactoryDefBuilder.setInitMethodName("init");
         servletFactoryDefBuilder.setDestroyMethodName("destroy");
         servletFactoryDefBuilder.addPropertyValue("serviceName", holder.getBeanName());
+        //this dependency is needed because JNet must be called manually when init() method
is called on servlet
+        //see COCOON-2236
+        servletFactoryDefBuilder.addPropertyReference("urlHandlerFactoryCollector", "org.apache.cocoon.jnet.URLHandlerFactoryCollector");
 
         servletFactoryDefBuilder.addPropertyValue("mountPath", mountPath);
         servletFactoryDefBuilder.addPropertyValue("contextPath", contextPath);

Modified: cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletFactoryBean.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletFactoryBean.java?rev=686261&r1=686260&r2=686261&view=diff
==============================================================================
--- cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletFactoryBean.java
(original)
+++ cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletFactoryBean.java
Fri Aug 15 08:52:30 2008
@@ -28,6 +28,7 @@
 
 import org.aopalliance.intercept.MethodInterceptor;
 import org.aopalliance.intercept.MethodInvocation;
+import org.apache.cocoon.jnet.URLHandlerFactoryCollector;
 import org.apache.cocoon.servletservice.Mountable;
 import org.apache.cocoon.servletservice.ServletServiceContext;
 import org.springframework.aop.framework.ProxyFactory;
@@ -67,6 +68,8 @@
     private String serviceName;
 
     private ServletServiceContext servletServiceContext;
+    
+    private URLHandlerFactoryCollector urlHandlerFactoryCollector;
 
     public ServletFactoryBean() {
     }
@@ -122,7 +125,14 @@
                 };
 
         // create and initialize the embedded servlet
-        this.embeddedServlet.init(blockServletConfig);
+        try {
+            //manual call to pushUrlHandlerFactories is needed due to issue COCOON-2236
+            urlHandlerFactoryCollector.pushUrlHandlerFactories();
+            this.embeddedServlet.init(blockServletConfig);
+        } finally {
+            urlHandlerFactoryCollector.popUrlHandlerFactories();
+        }
+        
         this.servletServiceContext.setServlet(this.embeddedServlet);
     }
 
@@ -261,4 +271,8 @@
         }
     }
 
+    public void setUrlHandlerFactoryCollector(URLHandlerFactoryCollector urlHandlerFactoryCollector)
{
+        this.urlHandlerFactoryCollector = urlHandlerFactoryCollector;
+    }
+
 }



Mime
View raw message