cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1303604 - in /cxf/branches/2.3.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java
Date Wed, 21 Mar 2012 22:19:21 GMT
Author: sergeyb
Date: Wed Mar 21 22:19:21 2012
New Revision: 1303604

URL: http://svn.apache.org/viewvc?rev=1303604&view=rev
Log:
Merged revisions 1303600 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.4.x-fixes

................
  r1303600 | sergeyb | 2012-03-21 22:08:09 +0000 (Wed, 21 Mar 2012) | 16 lines
  
  Merged revisions 1303598 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes
  
  ................
    r1303598 | sergeyb | 2012-03-21 22:02:51 +0000 (Wed, 21 Mar 2012) | 9 lines
    
    Merged revisions 1303595 via svnmerge from 
    https://svn.apache.org/repos/asf/cxf/trunk
    
    ........
      r1303595 | sergeyb | 2012-03-21 21:56:31 +0000 (Wed, 21 Mar 2012) | 1 line
      
      [CXF-4171] Setting the static sub resolution flag earlier
    ........
  ................
................

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/branches/2.5.x-fixes:r1303598
  Merged /cxf/branches/2.4.x-fixes:r1303600
  Merged /cxf/trunk:r1303595

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java?rev=1303604&r1=1303603&r2=1303604&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
Wed Mar 21 22:19:21 2012
@@ -87,6 +87,9 @@ public class CXFNonSpringJaxrsServlet ex
             address = "/";
         }
         bean.setAddress(address);
+        
+        bean.setStaticSubresourceResolution(getStaticSubResolutionValue(servletConfig));
+        
         String modelRef = servletConfig.getInitParameter(USER_MODEL_PARAM);
         if (modelRef != null) {
             bean.setModelRef(modelRef.trim());
@@ -108,15 +111,16 @@ public class CXFNonSpringJaxrsServlet ex
             bean.setResourceProvider(entry.getKey(), entry.getValue());
         }
         setExtensions(bean, servletConfig);
-        setStaticSubResolution(bean, servletConfig);
-        
+                
         bean.create();
     }
 
-    protected void setStaticSubResolution(JAXRSServerFactoryBean bean, ServletConfig servletConfig)
{
+    protected boolean getStaticSubResolutionValue(ServletConfig servletConfig) {
         String param = servletConfig.getInitParameter(STATIC_SUB_RESOLUTION_PARAM);
         if (param != null) {
-            bean.setStaticSubresourceResolution(Boolean.valueOf(param.trim()));
+            return Boolean.valueOf(param.trim());
+        } else {
+            return false;
         }
     }
     
@@ -354,11 +358,13 @@ public class CXFNonSpringJaxrsServlet ex
         Application app = (Application)createSingletonInstance(appClass, props, servletConfig);
         
         String ignoreParam = servletConfig.getInitParameter(IGNORE_APP_PATH_PARAM);
-        JAXRSServerFactoryBean bean = ResourceUtils.createApplication(app, MessageUtils.isTrue(ignoreParam));
+        JAXRSServerFactoryBean bean = ResourceUtils.createApplication(app, 
+                                            MessageUtils.isTrue(ignoreParam),
+                                            getStaticSubResolutionValue(servletConfig));
         setAllInterceptors(bean, servletConfig);
         setExtensions(bean, servletConfig);
         setSchemasLocations(bean, servletConfig);
-        setStaticSubResolution(bean, servletConfig);
+        
         bean.create();
     }
     

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java?rev=1303604&r1=1303603&r2=1303604&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java
Wed Mar 21 22:19:21 2012
@@ -540,8 +540,11 @@ public final class ResourceUtils {
         }
         return values;
     }
-    
     public static JAXRSServerFactoryBean createApplication(Application app, boolean ignoreAppPath)
{
+        return createApplication(app, ignoreAppPath, false);
+    }
+    public static JAXRSServerFactoryBean createApplication(Application app, boolean ignoreAppPath,
+                                                           boolean staticSubresourceResolution)
{
         
         Set<Object> singletons = app.getSingletons();
         verifySingletons(singletons);
@@ -587,6 +590,7 @@ public final class ResourceUtils {
             }
         }
         bean.setAddress(address);
+        bean.setStaticSubresourceResolution(staticSubresourceResolution);
         bean.setResourceClasses(resourceClasses);
         bean.setProviders(providers);
         for (Map.Entry<Class, ResourceProvider> entry : map.entrySet()) {



Mime
View raw message