项目场景:
IDEA创建Web项目
问题描述
编写jsp时,无法调用request方法
原因分析:
需要手动导入支持的jar包
解决方案:
- 使用maven项目:导入如下依赖
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
- 使用非maven项目:导入上面对应的jar包