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>

原因不详

时间: 03-13

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

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

今天调试SSM框架项目后台JSOn接口,报出来一个让人迷惑的错误:NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config 上网查了一下别人的博客 NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config 根据楼主的提示下载了zip,standard和jstl两个包放入tomcat lib下,再次运行发现报了404错误 HTTP Status 404 - /project_name/W

javax.servlet.jsp.JspException cannot be resolved

加入以下,解决 <properties> <jdk.version>1.6</jdk.version> <spring.version>3.2.8.RELEASE</spring.version> <spring.security.version>3.2.3.RELEASE</spring.security.version> <!-- Web --> <jsp.version>2.1</jsp

java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config

今天写SpringMvc时,遇到这样一个问题: java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config at org.springframework.web.servlet.support.JstlUtils.exposeLocalizationContext(JstlUtils.java:101) at org.springframework.web.servlet.view.JstlView.exposeHelpe

maven中解决Type javax.servlet.jsp cannot be resolved to a type

解决方案: 在Maven的pom文件中引发如下依赖jar: <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>2.2.1-b03</version> </dependency> <dependency> <groupId>javax.servlet<

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

<dependency> <groupId>javax.servlet</groupId> <artifactId>jsp-api</artifactId> <version>2.0</version> <scope>provided</scope> </dependency> 提供jsp-api的支持即可解决该问题. 注:provided 因为tomcat等容器中有该jar包,comp