在eclipse中,用maven新建web项目时,jsp页面报错: html
The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path. java
说明缺乏httpServlet,解决方法是: web
右键项目-Properties-Targeted Runtimes-选择本身要运行的服务器,好比 Apache Tomcat v7.0-ok! api
听说也能够在pom.xml中添加 服务器
<dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> </dependency>