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:45:28 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 45adf06d5 -> ea7d7c750


[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/ea7d7c75
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/ea7d7c75
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/ea7d7c75

Branch: refs/heads/2.7.x-fixes
Commit: ea7d7c7509eb44043477685ebc7e60a570e2d301
Parents: 45adf06
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:45:09 2015 +0000

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


http://git-wip-us.apache.org/repos/asf/cxf/blob/ea7d7c75/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 f3f3ca9..3f56405 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
@@ -50,6 +50,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";
+
     private DestinationRegistry destinationRegistry;
     private boolean globalRegistry;
     private Bus bus;
@@ -77,8 +79,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(this.bus);
             }
@@ -88,6 +89,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