|
20
|
| Mehraj Malik · 技术社区 · 8 年前 |
|
|
1
19
旧的Servlet容器不支持 ServletContextInitializer Servlet 3.0中使用的引导过程。您仍然可以在这些容器中使用Spring和Spring Boot,但需要添加一个web。并将其配置为加载 应用程序上下文 通过a DispatcherServlet . 为了创建可部署的war文件,需要提供 SpringBootServletInitializer 子类并重写其 配置 方法这利用了Spring框架的Servlet 3.0支持,并允许您在Servlet容器启动应用程序时配置应用程序。通常,您更新应用程序的主类以扩展 SpringBootServletInitializer .
您可以参考以下链接 https://docs.spring.io/spring-boot/docs/current/reference/html/howto-traditional-deployment.html |
|
|
2
7
以下是更多信息:
为了部署
我们也可以使用 WebApplicationInitializer 界面根据文件
SpringBoot建议使用
它使用JavaConfiguration而不是
它有
|