You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Glen Collins (JIRA)" <ji...@apache.org> on 2015/03/02 16:27:04 UTC
[jira] [Created] (CAMEL-8422) Rest DSL not resolving same endpoint
with different methods
Glen Collins created CAMEL-8422:
-----------------------------------
Summary: Rest DSL not resolving same endpoint with different methods
Key: CAMEL-8422
URL: https://issues.apache.org/jira/browse/CAMEL-8422
Project: Camel
Issue Type: Bug
Components: camel-servlet
Affects Versions: 2.14.0
Reporter: Glen Collins
Using the Java REST DSL we are having problems setting up a route for all HTTP methods using the same endpoint. It seems that when we use the same URL for the delete, post and put only the Delete method actually works. In the below example the GET and DELETE work fine but the PUT and POST do not. If we change these to be unique URL's they then work.
Route
rest("/registrations")
.get("/").to("direct:listRegistration")
.delete("/{id}").to("direct:deleteRegistration")
.post("/{id}").to("direct:createRegistration")
.put("/{id}").to("direct:updateRegistation");
web.xml
<!-- Camel servlet -->
<servlet>
<servlet-name>CamelServlet</servlet-name>
<servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Camel servlet mapping -->
<servlet-mapping>
<servlet-name>CamelServlet</servlet-name>
<url-pattern>/camel/*</url-pattern>
</servlet-mapping>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)