2016-11-17 69 views
0

我用Spring mvc 3.0.9開發了一些其他服務。在某些情況下,我有一個例外。這取決於我的春天版本使用Servlet 3.0 api(我的應用程序服務器是jboss eap 5.1)。什麼是與Servlet 2.5兼容的最新spring mvc版本?謝謝。春天mvc與Servlet 2.5兼容

+0

http://stackoverflow.com/questions/24217568/does-spring-3-2-require-servlet-3-0-or-it-works-with-servlet-2-5 – sura2k

回答

0

Spring 3.2應該使用Servlet 2.5 API。

只有春天4.0要求的Serlvet 3.0:

參考這個官方documentation獲取更多信息。

3 New Features and Enhancements in Spring Framework 4.0)

3.4 Java EE 6 and 7

Java EE version 6 or above is now considered the baseline for Spring Framework 4, with the JPA 2.0 and Servlet 3.0 specifications being of particular relevance.

+0

不,版本3.2使用Servlet 3.0,FrameWorkServlet使用Servlet 3.0的HttpServletResponse方法: 'java.lang.NoSuchMethodError:javax.servlet.http.HttpServletResponse.getHeader(Ljava/lang/String;)Ljava/lang/String;在框架服務器。 –

0

Spring 4.0與Servlet 2.5一起工作。

見文件:(https://docs.spring.io/spring/docs/4.3.14.RELEASE/spring-framework-reference/htmlsingle/

3.4的Java EE 6和7

Java EE version 6 or above is now considered the baseline for Spring Framework 4, with the JPA 2.0 and Servlet 3.0 specifications being of particular relevance. In order to remain compatible with Google App Engine and older application servers, it is possible to deploy a Spring 4 application into a Servlet 2.5 environment. However, Servlet 3.0+ is strongly recommended and a prerequisite in Spring’s test and mock packages for test setups in development environments.

3.7通用的Web改進

Deployment to Servlet 2.5 servers remains an option, but Spring Framework 4.0 is now focused primarily on Servlet 3.0+ environments. If you are using the Spring MVC Test Framework you will need to ensure that a Servlet 3.0 compatible JAR is in your test classpath.