JSP页面pageContext.getRequest()报红
ServletRequest req = pageContext.getRequest();
1、在pom中添加jsp-api依赖
<!-- https://mvnrepository.com/artifact/javax.servlet.jsp/javax.servlet.jsp-api --> <dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.3</version>
<scope>provided</scope>
</dependency>
2、在每个jsp页面添加<%@page isELIgnored="false"%>
以上是 JSP页面pageContext.getRequest()报红 的全部内容, 来源链接: utcz.com/z/512183.html