Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.14.0
-
None
-
Unknown
Description
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("/
.post("/{id}
").to("direct:createRegistration")
.put("/
").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>
Attachments
Issue Links
- blocks
-
CAMEL-7952 Camel REST does not handle same path with differents VERBS
- Closed