在jsp页面,使用IDEA编写程序,向page域中写入数据时,需要用到pageContext.setAttribute,但是出现如下错误提示:
解决方法:在pom.xml文件添加jsp-api依赖。如果不是maven那就直接下载jar包。
<!-- https://mvnrepository.com/artifact/javax.servlet.jsp/jsp-api -->
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>