I am working in REST webservice. I was going through some blogs and there I saw for mapping of URL to a method, they used different annotations.
Some places used @RequestMapping
and some places used @Path
.
How does both differ?
Asked
Active
Viewed 1.7k times
20
1 Answers
30
It depends on the framework that creates the Web service
@RequestMapping
is an annotation used in Spring framework
https://spring.io/guides/gs/rest-service/
@Path
is an annotation used in frameworks implementing JAX-RS API, such as Jersey
https://jersey.java.net/documentation/latest/jaxrs-resources.html#d0e2001
If you want to know which one is better, this topic may help