does spring 3.2 require servlet 3.0 or it works wi

2019-06-01 17:19发布

问题:

I am using spring 3.2.4 in my application but some of the features are not working properly like @controllerAdvice. I know that it is a feature added in spring 3.2. I am using servlet 2.5.I googled about spring 3.2 and found that

The Spring MVC programming model now provides explicit Servlet 3 async support.

Kindly tell me does spring 3.2 works with servlet 2.5 or not?

回答1:

Spring 3.2 should work with Servlet 2.5 API.

Only Spring 4.0 requires Serlvet 3.0:

(http://docs.spring.io/spring/docs/current/spring-framework-reference/html/new-in-4.0.html)

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. 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.