How to add path param to sling servlet url ?
eg, /services/demo/path/{var1}/{var2}.html
Solved! Go to Solution.
Views
Replies
Total Likes
I assume you are looking for a similar way to place variables in paths of a URL - like you can with Spring - ie:
@RequestMapping(value = "/{id}/ViewMyForm.do", method = RequestMethod.POST)
However - in Sling - a Request Parameter syntax is as follows.
Request Parameters
A request parameter is like an input to a function. If you know you have some kind of operation that occurs at /get/me/some/info.json, you can attach request parameters to your GET request URI to retrieve the output of that servlet. For example, /get/me/some/info.json?on=football tells the servlet that you want some information on football.
- See more at:
http://www.citytechinc.com/us/en/blog/2013/08/apache-sling-selectors-request-parameters.html
Views
Replies
Total Likes
I assume you are looking for a similar way to place variables in paths of a URL - like you can with Spring - ie:
@RequestMapping(value = "/{id}/ViewMyForm.do", method = RequestMethod.POST)
However - in Sling - a Request Parameter syntax is as follows.
Request Parameters
A request parameter is like an input to a function. If you know you have some kind of operation that occurs at /get/me/some/info.json, you can attach request parameters to your GET request URI to retrieve the output of that servlet. For example, /get/me/some/info.json?on=football tells the servlet that you want some information on football.
- See more at:
http://www.citytechinc.com/us/en/blog/2013/08/apache-sling-selectors-request-parameters.html
Views
Replies
Total Likes