Eclipse Maven新建webapp项目index.jsp报错

Eclipse   Maven新建webapp项目时会出现 index.jsp报错的情况


这种情况一般可以有两种解决方式

1.直接在 pom.xml 文件中添加支持

                <dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<version>3.1.0</version>
		</dependency>

添加好后,保存pom.xml 和jsp。

2.添加tomcat支持

     首先選中項目右鍵選擇“Bulid Path”,再選擇“Configure Build Path”


        然後選擇Librarees選項卡  ,再點擊右邊  Add Library,選擇Server Runtime .

      

    

 然后保存即可解决报错问题

猜你喜欢

转载自blog.csdn.net/qq_37268124/article/details/79890333