REST Web服务中@Path和@Requestmapping之间的区别 [英] Difference between @Path and @Requestmapping in REST webservice
问题描述
我正在使用REST Web服务.我浏览了一些博客,在那里看到了URL到方法的映射,他们使用了不同的注释.
有些地方使用@RequestMapping
,有些地方使用@Path
.
两者有何不同?
这取决于创建Web服务的框架
@RequestMapping
是Spring框架中使用的注释
https://spring.io/guides/gs/rest-service/ >
@Path
是在实现JAX-RS API的框架(例如Jersey)中使用的注释
https://jersey.java.net/documentation/latest/jaxrs-resources .html#d0e2001
如果您想知道哪个更好,请本主题可能有帮助
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
这篇关于REST Web服务中@Path和@Requestmapping之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!