REST URL mapping with parameter in web.xml
What url-pattern
should we be putting in web.xml for making my servlet listen on this path, /{name}/servlet
?
Here, name
is a variable so I should be able to listen on
http:8080//testproject/xyz/servlet
or
http:8080//testproject/abc/servlet
.
Here xyz
is a variable name. This is basically a REST URL with parameters, though i can use @Path
and @PathParam
, but I want to do i开发者_如何学编程t in web.xml only.
<servlet-name> A </servlet-name>
<url-pattern> /{}/sevlet </url-pattern>
Any clues to what put for variable string in the url
You can look into servlet filters
精彩评论