首页 > 解决方案 > Use of Spring 5.3 with Servlet 3.0

问题描述

I'm working on application which uses Spring Core in version 4.3.14 and Spring Web in version 4.2.13. We don't use Spring MVC. Also, from Spring Web we use just very limited set of classes:

My question is: We want to migrate to Spring 5.x. Is such a migration really possible? Or should i expect some severe problems with application startup (class incompatibilites etc). This source for example: https://github.com/spring-projects/spring-framework/wiki/What%27s-New-in-Spring-Framework-5.x#whats-new-in-version-50 says that Servlet 3.1 is required

From the other side, here https://spring.io/blog/2015/06/10/feedback-welcome-spring-5-system-requirements JUERGEN HOELLER wrote that migration to Spring 5 will be a soft one. So i assume that if Application uses only features from JEE6 + Servlet 3.0, then it can be that it will also work on Spring 5.x with JEE6-compatible appserver

Does anyone have an experience in that?

标签: springspring-mvcservlets

解决方案


与往常一样,Spring Framework 使用新的主要版本升级其基线。在这种情况下,我们需要 JDK8+ 和 Java EE7+

实际上,这意味着编译后的代码依赖于这些 API,不再使用反射来适应它们。就您而言,这不仅与 Servlet 有关,还与 JPA、JMS、bean 验证和其他规范有关。

您的应用程序可能会在您提到的安排下正常工作,但 Spring 团队不会保证支持此设置。


推荐阅读