Spring MVC是否支持JSR 311注释? [英] Does Spring MVC support JSR 311 annotations?

查看:162
本文介绍了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注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆