在pom.xml中添加依赖
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
tomcat启动后报错:
严重: The web application [/mywebapp] registered the JBDC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped.
解决:dependency中添加:
<scope>provided</scope>
作用是,限制该依赖只在编译和测试的时候用,这样在tomcat启动时就不会产生冲突。