ServletRequest req = pageContext.getRequest();
一、在pom中添加jsp-api依賴java
<!-- 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>
二、在每一個jsp頁面添加<%@page isELIgnored="false"%>api