I have a servlet and using a camel route to listen request from the servlet as below:
from("servlet:///basepath?matchOnUriPrefix=true")
There is no problem with that, since matchOnUriPrefix is true, requests for the following url pattern are successfully listened by the route:
host:port/basepath/dynamicSubPath
What I want to have is that, is there any way that I can make the path variable (dynamicSubPath) to bind to an exchange property?
I know that I can get the path as below:
String path = exchange.getIn().getHeader(Exchange.HTTP_PATH, String.class);
But I dont want to do such string parsing. In spring mvc I can inject path variables to the controller as below:
@RequestMapping(path = "/basepath/{dynamicSubPath}", method = RequestMethod.GET)
and then can get the dynamicSubPath variable as below:
@PathVariable String dynamicSubPath
Is there a similar thing possible for camel servlet component?