jsp使用c:forEach报错 javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext的问题

今天发现了一个折磨我一天的问题:

在jsp文件中使用

<c:forEach items="${checkResult}" var="item">

</c:forEach>

一直报错:

[ERROR] 2013-12-09 15:03:20,740 method:org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:253)
Servlet.service() for servlet org.apache.jsp.baseattrib.singActivation_jsp threw exception
java.lang.AbstractMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext;
        at javax.servlet.jsp.jstl.core.LoopTagSupport.unExposeVariables(LoopTagSupport.java:587)
        at javax.servlet.jsp.jstl.core.LoopTagSupport.doFinally(LoopTagSupport.java:323)
        at org.apache.jsp.baseattrib.singActivation_jsp._jspService(singActivation_jsp.java:800)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at com.zte.web.FilterEconding.doFilter(FilterEconding.java:38)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)

但是输出单个变量没有问题,只是使用forEach时候出错

我是用的环境是:JDK1.6+tomcat1.6

解决办法:删除jstl1.2的依赖,然后添加1.1.0的依赖和standard1.1.0的依赖

pom.xml的文件修改为:

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>jstl</artifactId>
    <version>1.1.0</version>
    <type>jar</type>
    <scope>compile</scope>
</dependency>
<dependency>
    <groupId>taglibs</groupId>
    <artifactId>standard</artifactId>
    <version>1.1.0</version>
</dependency>

原因不详

时间: 2024-12-27 15:40:13

jsp使用c:forEach报错 javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext的问题的相关文章

JSP标签c forEach报错(一)

1.jsp标签c:forEach报错,具体错误如下: 三月 31, 2014 9:31:14 下午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet [jsp] in context with path [/HighCharts] threw exception [Unable to compile class for JSP: An error occurred at l

1,eclipse导入项目jdk版本不一样解决方案 2,java报javax.servlet.jsp cannot be resolved to a type

一:eclipse导入项目jdk版本不一样解决方案 参考博文: https://www.cnblogs.com/chenmingjun/p/8472885.html 选中项目右键 --> Properties --> Build Path --> 选中Libraries一栏,移除(Remove)这个库选项, 然后添加新的库选项: Add Library... --> JRE System Library --> next --> Execution environmen

javax.servlet.jsp cannot be resolved to a type

把MyEclipse里的项目导入到Eclipse Luna版中后出现了个莫名其妙的错误,注:Eclipse Luna是新装的. 错误描述:jsp页面中引用的js报错,鼠标放上去以后提示:javax.servlet.jsp cannot be resolved to a type.图片为证: 类似以上底下有红色波浪线的错误,好多jsp页面都有,还各不相同. 解决办法: 点击菜单栏:Window→Preferences→Validation,在右侧找"JSP Syntax Validator&quo

javax.servlet.jsp cannot be resolved to a type,javax.servlet

可能是jdk 里不包括servlet-api.jar这个包,到tomcat里找到这个包复制到java项目里. 项目名-->右键 Property-->选择 Java Build Path-->选择 Add External JARs-->选择 把servlet-api.jar的路径输入即可 该包在tomcat里有 搜索即课找到 javaxservletjspJspException cannot be resolved to a type javaxservletjspPageCo

对于NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config的异常

NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config 使用spring mvc进行开发,使用tomcat容器,通过url映射寻找view的时候,会报错NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config,如果随便去找个jstl包过来放入web-inf/lib会报错,将standard和jstl两个包放入lib下即可

org.apache.struts.taglib.bean.CookieTei cannot be cast to javax.servlet.jsp.tagext.TagExtraInfo

严重: Servlet.service() for servlet jsp threw exceptionjava.lang.ClassCastException: org.apache.struts.taglib.bean.CookieTei cannot be cast to javax.servlet.jsp.tagext.TagExtraInfo at org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibra

NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config的问题

故障问题: 使用springMVC3.05 ,tomcat服务器进行开发, Spring配置正确,console有输出,但是url打开时不能出现页面,提示错误信息为:NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config 解决办法: 随便找个jstl包过来放入web-inf/lib会报错,正确的下载地址在这里,下载jakarta-taglibs-standard-1.1.2.zip这个包,解压缩后将standard和jstl两个包放入li

Eclipse------导入项目后出现javax.servlet.jsp cannot be resolved to a type

报错信息:javax.servlet.jsp cannot be resolved to a type 原因1: 这个错误可能是服务器自带的servlet库未导入的原因. 解决方法: 右键项目"Properties",转到Targeted Runtimes,选择一个服务器,例如Tomcat,单击应用,可能就可以解决. 原因2: servlet包只是编译时需要,而发布时不需要,避免与tomcat中的servlet包发生冲突 解决方法: 在pom.xml中添加对servlet-api的依赖

The import javax.servlet.jsp.JspException cannot be resolved

问题描述 ??重新更换了 Apache Tomcat 的版本,在 Eclipse 中项目报错信息:The import javax.servlet.jsp.JspException cannot be resolved 解决方法 ??重新配置一下工程路径,配置服务器. Eclipse -> Project -> Clean... 一下工程; 右键 工程项目 -> Build Path -> Configure Build Path... -> Java Build Path