cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6658] Optionally ignoring ServletContextResourceResolver
Date Fri, 30 Oct 2015 12:39:57 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 4d4df394a -> 8dc621b15


[CXF-6658] Optionally ignoring ServletContextResourceResolver


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8dc621b1
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8dc621b1
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8dc621b1

Branch: refs/heads/master
Commit: 8dc621b15eea527f090edbe61533e3345eb7aea8
Parents: 4d4df39
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Fri Oct 30 12:39:39 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Fri Oct 30 12:39:39 2015 +0000

----------------------------------------------------------------------
 .../cxf/transport/servlet/CXFNonSpringServlet.java   | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/8dc621b1/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java
b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java
index e914b1d..d1220bc 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java
@@ -49,7 +49,8 @@ import org.apache.cxf.transport.servlet.servicelist.ServiceListGeneratorServlet;
 
 public class CXFNonSpringServlet extends AbstractHTTPServlet {
     private static final long serialVersionUID = -2437897227486327166L;
-   
+    private static final String IGNORE_SERVLET_CONTEXT_RESOLVER = "ignore.servlet.context.resolver";
+    
     protected Bus bus;
     private DestinationRegistry destinationRegistry;
     private boolean globalRegistry;
@@ -77,8 +78,7 @@ public class CXFNonSpringServlet extends AbstractHTTPServlet {
         }
         if (this.bus != null) {
             loader = initClassLoader();
-            ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
-            resourceManager.addResourceResolver(new ServletContextResourceResolver(sc.getServletContext()));
+            registerServletContextResolver(sc);
             if (destinationRegistry == null) {
                 this.destinationRegistry = getDestinationRegistryFromBus();
             }
@@ -88,6 +88,15 @@ public class CXFNonSpringServlet extends AbstractHTTPServlet {
         finalizeServletInit(sc);
     }
 
+    protected void registerServletContextResolver(ServletConfig sc) {
+        if (Boolean.valueOf(sc.getInitParameter(IGNORE_SERVLET_CONTEXT_RESOLVER))) {
+            return;
+        }
+        
+        ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
+        resourceManager.addResourceResolver(new ServletContextResourceResolver(sc.getServletContext()));
+    }
+
     protected ClassLoader initClassLoader() {
         return bus.getExtension(ClassLoader.class);
     }


Mime
View raw message