Does Spring MVC support JSR 311 annotations?

陌路散爱 提交于 2019-12-08 16:45:42

问题


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.

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?


回答1:


Short answer: NO. To quote Juergen Hoeller:

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.

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

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



来源:https://stackoverflow.com/questions/7518391/does-spring-mvc-support-jsr-311-annotations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!