A
WebApplicationInitializer基本上是Servlet
3.0的Spring扩展
ServletContainerInitializer。
您无法做一些事情
ServletContainerInitializer,或者
ServletContext更具体地说,其中之一是配置一些安全组件,例如
login-config。
相反,你可以同时拥有
ServletContainerInitializer和
web.xml使用属性
metadata-complete设置为
false。例如,
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" metadata-complete="false" version="3.0">
然后在其中添加
<login-config>元素。



