2016-11-17 5 views
0

私はSpring mvc 3.0.9でいくつかの休憩サービスを開発しました。場合によっては例外があります。私のSpringバージョンでは、Servlet 3.0 API(私のアプリケーションサーバーはjboss eap 5.1)を使用しているかどうかによって異なります。 Servlet 2.5と互換性のある最新のspring mvcバージョンは何ですか?ありがとう。Spring mvc compatibile with Servlet 2.5

+0

http://stackoverflow.com/questions/24217568/do-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; \t at org.springframework.web.servlet.FrameworkServlet.doOptions(FrameworkServlet.java:865) ' –

0

サーブレット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一般的なウェブの改善

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.