@WebServlet在内嵌容器不起作用吗,一定要用@ServletComponentScan吗?
来源:6-12 自定义 Resolver 实现

烟台果农
2018-08-29
写回答
1回答
-
小马哥
2018-08-29
是的,Spring Boot 嵌入式 Servlet 容器将默认的 Servlet 3.0 ServletContainerInitializer 特性取消了,因此只能通过这种方式实现。
Embedded servlet containers do not directly execute the Servlet 3.0+ javax.servlet.ServletContainerInitializer interface or Spring’sorg.springframework.web.WebApplicationInitializer interface. This is an intentional design decision intended to reduce the risk that third party libraries designed to run inside a war may break Spring Boot applications.
00
相似问题
判断引导类的作用
回答 1
不能启动是什么原因呢?谢谢!
回答 4