cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: Fix for the dispatcher test in 2.7.x
Date Wed, 12 Mar 2014 13:38:35 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 7f5e4d8af -> ca38df201


Fix for the dispatcher test in 2.7.x


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

Branch: refs/heads/2.7.x-fixes
Commit: ca38df201a2d716e038887cb6f781797328066e8
Parents: 7f5e4d8
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Wed Mar 12 13:38:13 2014 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Wed Mar 12 13:38:13 2014 +0000

----------------------------------------------------------------------
 .../cxf/transport/servlet/AbstractHTTPServlet.java      | 12 +++++++++---
 .../resources/jaxrs_dispatch_simple/WEB-INF/web.xml     |  8 ++++++++
 2 files changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/ca38df20/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/AbstractHTTPServlet.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/AbstractHTTPServlet.java
b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/AbstractHTTPServlet.java
index 353f693..21a40e7 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/AbstractHTTPServlet.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/AbstractHTTPServlet.java
@@ -340,7 +340,8 @@ public abstract class AbstractHTTPServlet extends HttpServlet implements
Filter
     protected void redirect(HttpServletRequest request, HttpServletResponse response, String
pathInfo) 
         throws ServletException {
         
-        String theServletPath = dispatcherServletPath == null ? "/" : dispatcherServletPath;
+        boolean customServletPath = dispatcherServletPath != null;
+        String theServletPath = customServletPath ? dispatcherServletPath : "/";
         
         ServletContext sc = super.getServletContext();
         RequestDispatcher rd = dispatcherServletName != null 
@@ -358,7 +359,7 @@ public abstract class AbstractHTTPServlet extends HttpServlet implements
Filter
                 request.setAttribute(entry.getKey(), entry.getValue());
             }
             HttpServletRequestFilter servletRequest = 
-                new HttpServletRequestFilter(request, pathInfo, theServletPath);
+                new HttpServletRequestFilter(request, pathInfo, theServletPath, customServletPath);
             rd.forward(servletRequest, response);
         } catch (Throwable ex) {
             throw new ServletException("RequestDispatcher for path " + pathInfo + " has failed");
@@ -374,12 +375,17 @@ public abstract class AbstractHTTPServlet extends HttpServlet implements
Filter
         private String pathInfo;
         private String servletPath;
         
+        
         public HttpServletRequestFilter(HttpServletRequest request, 
                                         String pathInfo,
-                                        String servletPath) {
+                                        String servletPath,
+                                        boolean customServletPath) {
             super(request);
             this.pathInfo = pathInfo;
             this.servletPath = servletPath;
+            if (pathInfo != null && "/".equals(this.servletPath) && !customServletPath)
{
+                this.servletPath = "";
+            }
         }
         
         @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/ca38df20/systests/jaxrs/src/test/resources/jaxrs_dispatch_simple/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/resources/jaxrs_dispatch_simple/WEB-INF/web.xml b/systests/jaxrs/src/test/resources/jaxrs_dispatch_simple/WEB-INF/web.xml
index b55ed6a..762a5b0 100644
--- a/systests/jaxrs/src/test/resources/jaxrs_dispatch_simple/WEB-INF/web.xml
+++ b/systests/jaxrs/src/test/resources/jaxrs_dispatch_simple/WEB-INF/web.xml
@@ -43,6 +43,10 @@
         <param-name>redirect-servlet-name</param-name>
         <param-value>default</param-value>
     </init-param>
+    <init-param>
+		      <param-name>disable-address-updates</param-name>
+		      <param-value>true</param-value>    
+	</init-param>
     <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
@@ -51,6 +55,10 @@
         <servlet-class>
           org.apache.cxf.transport.servlet.CXFServlet
         </servlet-class>  
+        <init-param>
+		      <param-name>disable-address-updates</param-name>
+		      <param-value>true</param-value>    
+		</init-param>
         <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>


Mime
View raw message