servlet3.0以后可以不用web.xml配置了
AbstractDispatcherServletInitializer
注意:删除了web.xml会报错,web.xml is missing and <failOnMissingWebXml> is set to true,解决如下
<plugin>
<groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.0.0</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin>