Spring MVC是否支持JSR 311注释?

编程入门 行业动态 更新时间:2024-10-25 23:35:26
本文介绍了Spring MVC是否支持JSR 311注释?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在帮助别人的同时,我注意到他们正在尝试使用@GET,@Consumes和@Path批注进行Spring开发.据我了解,这些注释来自JSR-311规范.

While helping out someone else, I noticed they were trying to do Spring development using the @GET, @Consumes, and @Path annotations. It is my understanding that these annotations come from the JSR-311 specification.

我只是建议他们使用Spring @RequestMapping批注将端点映射到其控制器,但这使我好奇Spring MVC(任何版本)是否支持JSR 311?

I simply suggested that they use the Spring @RequestMapping annotation for mapping endpoints to their controller, but it made me curious as to whether or not Spring MVC (any version) supports JSR 311?

推荐答案

简短答案:否.引用 Juergen Hoeller :

Short answer: NO. To quote Juergen Hoeller:

我们正在考虑在独立的基础上与JAX-RS集成-与Spring MVC自己的端点模型分开-可能支持在Spring Web应用程序上下文中将Jersey(JAX-RS RI)与Spring风格的bean一起使用.这取决于Spring 3.0 RC1的JSR 311和Jersey的最终确定时间,这也可能使Spring 3.0成为可能.否则,它将成为Spring 3.1的候选人.

We're considering integration with JAX-RS on a separate basis - separate from Spring MVC's own endpoint model -, possibly supporting the use of Jersey (the JAX-RS RI) with Spring-style beans in a Spring web application context. This might make Spring 3.0 as well, depending on the finalization of JSR 311 and Jersey in time for Spring 3.0 RC1. Otherwise it would be a candidate for Spring 3.1.

但是我在3.0和3.1中都没有找到这种支持.

However I haven't found such a support neither in 3.0 nor in 3.1.

当然,您可以集成Apache CXF之类的框架并使用标准的JSR-311注释. Spring MVC本身无法识别这些注释.

Of course you can integrate frameworks like Apache CXF and use standard JSR-311 annotations. Spring MVC itself does not recognize these annotations.

更多推荐

Spring MVC是否支持JSR 311注释?

本文发布于:2023-10-07 17:27:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1470021.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:注释   MVC   Spring   JSR

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!