jsp页面报错: javax.servlet.jsp.PageContext cannot be resolved to a type

来源:互联网 发布:四川网络教育学校 编辑:程序博客网 时间:2024/05/16 15:48

问题:当从一个项目中拷贝jsp文件到另一个项目中出现报错:javax.servlet.jsp.PageContext cannot be resolved to a type


是因为缺少相关jar包引起的,有两种解决方法,第一种就是添加相关jar包,第二种将项目部署到tomcat服务器当中(因为tomcat环境中含有此依赖)
解决方法一:添加依赖(推荐)
        <dependency>              <groupId>javax.servlet</groupId>              <artifactId>javax.servlet-api</artifactId>              <version>3.1.0</version>          </dependency>          <dependency>              <groupId>javax.servlet.jsp</groupId>              <artifactId>jsp-api</artifactId>              <version>2.2.1-b03</version>          </dependency>  


解决方法二:将项目部署到tomcat服务当中

这种问题的解决办法是把这个项目在服务器上部署一下就可以了,如下:


0 0