简体   繁体   中英

Difference between @Path and @Requestmapping in REST webservice

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM