0

I have developed some rest services with Spring mvc 3.0.9. In some case I have an exception. It depends that my spring version use Servlet 3.0 api (my application server is jboss eap 5.1). What is latest spring mvc version compatible with Servlet 2.5? Thanks.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Michel Foucault
  • 1,724
  • 3
  • 25
  • 48
  • http://stackoverflow.com/questions/24217568/does-spring-3-2-require-servlet-3-0-or-it-works-with-servlet-2-5 – sura2k Nov 18 '16 at 11:15

2 Answers2

0

Spring 3.2 should work with Servlet 2.5 API.

Only Spring 4.0 requires Serlvet 3.0:

refer this official documentation for more info.

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.

Sundararaj Govindasamy
  • 8,180
  • 5
  • 44
  • 77
  • No, the version 3.2 uses Servlet 3.0, the FrameWorkServlet use a method of HttpServletResponse of Servlet 3.0: `java.lang.NoSuchMethodError: javax.servlet.http.HttpServletResponse.getHeader(Ljava/lang/String;)Ljava/lang/String; at org.springframework.web.servlet.FrameworkServlet.doOptions(FrameworkServlet.java:865) ` – Michel Foucault Nov 17 '16 at 22:55
0

Spring 4.0 work with Servlet 2.5.

See document: (https://docs.spring.io/spring/docs/4.3.14.RELEASE/spring-framework-reference/htmlsingle/)

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. 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 General Web Improvements

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.

Lancer
  • 1