开发者

REST URL mapping with parameter in web.xml

开发者 https://www.devze.com 2023-03-14 09:20 出处:网络
What url-pattern should we be putting in web.xml for making my servlet listen on this path, /{name}/servlet?

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

0

精彩评论

暂无评论...
验证码 换一张
取 消