You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Alex (JIRA)" <ji...@apache.org> on 2015/04/10 19:33:12 UTC
[jira] [Created] (OLINGO-627) How to use ODataServlet or
CXFNonSpringJaxrsServlet for multiple endpoints
Alex created OLINGO-627:
---------------------------
Summary: How to use ODataServlet or CXFNonSpringJaxrsServlet for multiple endpoints
Key: OLINGO-627
URL: https://issues.apache.org/jira/browse/OLINGO-627
Project: Olingo
Issue Type: Question
Components: odata2-core
Affects Versions: V2 2.0.3
Reporter: Alex
Hello. Thanks for your work.
I'm just struggling with a problem of using one servlet for multiple endpoints.
I have created the service and now it works at /service.svc/*
The problem I faced with is I want to introduce multiple endpoints for one servlet.
for example we have a users table, so user should be able to use service using own URL format
/username/updates/
/alex/updates/ etc
I tried to create a filter which gets getRequestDispatcher and forwards requests but the I didn't get how to change the context, i.e mapping works but in entities it returns URIs for resources using /service.svc/* mapping
any ideas what to extend and override in order to support multiple endpoints?
As I know, JAX-RS supports something like this Application("/{user}/updates") to match URL parameters.
Thanks in advance.
<servlet>
<servlet-name>MyODataSampleServlet</servlet-name>
<servlet-class>org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>org.apache.olingo.odata2.core.rest.app.ODataApplication</param-value>
</init-param>
<init-param>
<param-name>org.apache.olingo.odata2.service.factory</param-name>
<param-value>org.apache.olingo.odata2.sample.service.MyServiceFactory</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>MyODataSampleServlet</servlet-name>
<url-pattern>/service.svc/*</url-pattern>
</servlet-mapping>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)