Maven 梳理 - maven新建web项目提示"javax.servlet.http.HttpServlet" was not found on the Java Build Path

方法一:

<dependency>  
    <groupId>javax.servlet</groupId>  
    <artifactId>servlet-api</artifactId>  
    <version>2.5</version>  
    <scope>provided</scope>  
</dependency>

 

方法二:

Java Build Path -> Libraries ->Add Library… -> Server Runtime ->Next。 具体如下所示:

  

 

点击Next后选择我们之前配置的Apache Tomcat v9.0,然后点击Finish即可。添加完Libraries后不要忘记点击Apply按钮以及OK按钮。

posted on 2018-11-24 10:15  手握太阳  阅读(1082)  评论(0编辑  收藏  举报

导航