maven新建 webapp項目後JSP文件報錯怎樣chul

在pom.xml配置文件中添加上javax.servlet的相關依賴:

  <dependencies>
  
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    
   <dependency>
     <groupId>javax.servlet</groupId>
     <artifactId>servlet-api</artifactId>
     <version>2.5</version>
     <scope>provided</scope>
  </dependency>

    
  </dependencies>

依賴tomcat類庫:

項目右擊—>build path —> configure build path — >libraries — > add libraries —> Server Runtime — >選擇tomcat —> ok


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章