在pom.xml文件中加入servlet依赖
<dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId><version>2.5</version> <scope>provided</scope> </dependency>