olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject [16/37] olingo-odata2 git commit: Minor fix in combination with Spring/CXFServlet
Date Tue, 27 Jan 2015 19:25:14 GMT
Minor fix in combination with Spring/CXFServlet


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/1ee1ff43
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/1ee1ff43
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/1ee1ff43

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 1ee1ff4334f5f3d993aa1e772c0e9b4e55c7dc82
Parents: a339d29
Author: Michael Bolz <michael.bolz@sap.com>
Authored: Tue Dec 23 11:09:46 2014 +0100
Committer: Michael Bolz <michael.bolz@sap.com>
Committed: Tue Dec 23 11:09:46 2014 +0100

----------------------------------------------------------------------
 .../java/org/apache/olingo/odata2/core/rest/RestUtil.java    | 8 +++++---
 pom.xml                                                      | 1 -
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1ee1ff43/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rest/RestUtil.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rest/RestUtil.java
b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rest/RestUtil.java
index 8cb200d..b726f9b 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rest/RestUtil.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rest/RestUtil.java
@@ -37,6 +37,7 @@ import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.ResponseBuilder;
 import javax.ws.rs.core.UriBuilder;
+import javax.ws.rs.core.UriInfo;
 
 import org.apache.olingo.odata2.api.commons.HttpHeaders;
 import org.apache.olingo.odata2.api.exception.ODataBadRequestException;
@@ -180,7 +181,8 @@ public class RestUtil {
   public static PathInfoImpl buildODataPathInfo(final SubLocatorParameter param) throws ODataException
{
     PathInfoImpl pathInfo = splitPath(param);
 
-    pathInfo.setServiceRoot(buildBaseUri(param.getServletRequest(), pathInfo.getPrecedingSegments()));
+    pathInfo.setServiceRoot(buildBaseUri(param.getUriInfo(),
+        param.getServletRequest(), pathInfo.getPrecedingSegments()));
     pathInfo.setRequestUri(buildRequestUri(param.getServletRequest()));
 
     return pathInfo;
@@ -224,10 +226,10 @@ public class RestUtil {
     return pathInfo;
   }
 
-  private static URI buildBaseUri(final HttpServletRequest request,
+  private static URI buildBaseUri(final UriInfo uriInfo, final HttpServletRequest request,
       final List<PathSegment> precedingPathSegments) throws ODataException {
     try {
-      String path = request.getContextPath() + request.getServletPath();
+      String path = uriInfo.getBaseUri().getPath();
       UriBuilder uriBuilder = UriBuilder.fromUri(path);
       for (final PathSegment ps : precedingPathSegments) {
         uriBuilder = uriBuilder.path(ps.getPath());

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1ee1ff43/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 1c8875b..67ae922 100644
--- a/pom.xml
+++ b/pom.xml
@@ -82,7 +82,6 @@
 		<module>odata2-annotation-processor</module>
 		<module>odata2-dist</module>
 		<module>odata2-sample</module>
-        	<module>odata2-spring</module>
 	</modules>
 
 	<build>


Mime
View raw message