Service Resolution

An OData service usually starts with "/" which delivers the service document while all preceding path segments belong to the servlet and servlet mapping of a web application.

Some service providers would like to get control over the path hierarchy. This is called service resolution. Actually it means an OData path can start at any hierarchy path level behind the service mapping path elements.

An uri schema with and without service resolution is shown here:

Picture: Service Resolution

A service init parameter (org.apache.olingo.odata2.path.split) can be set for servlet configuration (see web.xml) and define how many path segments are not interpreted as OData path segments. In the example the split value is 2 and the resulting service resolution uses two path segments. The first one is for and the secound for .


A processor implementation (e.g. ODataSingleProcessor) does have access to an ODataContext object which will deliver a PathInfo object. From this class a processor implementation can access the service resolution information which is as following:

Sample Code

public interface ODataContext {
  ODataService getService() throws ODataException;
  PathInfo getPathInfo() throws ODataException;

public interface PathInfo {
  List<PathSegment> getPrecedingSegments();
  List<PathSegment> getODataSegments();
  URI getServiceRoot();
  URI getRequestUri();

Copyright © 2013-2022, The Apache Software Foundation
Apache Olingo, Olingo, Apache, the Apache feather, and the Apache Olingo project logo are trademarks of the Apache Software Foundation.