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 line: 17 in the jsp file: /JSP/forEach.jsp Syntax error on token ""O"", delete this token 14: <hr> 15: <% 16: String[] array = { "A", "B", "C", "D", "E", "F","G","H","I","J","K","L","M","N" 17: "O","P","Q","R","S","T","U","V","W","X","Y","Z"}; 18: request.setAttribute("array", array); 19: %> 20: <c:forEach items="${array}" var="arr"> Stacktrace:] with root cause org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 17 in the jsp file: /JSP/forEach.jsp Syntax error on token ""O"", delete this token 14: <hr> 15: <% 16: String[] array = { "A", "B", "C", "D", "E", "F","G","H","I","J","K","L","M","N" 17: "O","P","Q","R","S","T","U","V","W","X","Y","Z"}; 18: request.setAttribute("array", array); 19: %> 20: <c:forEach items="${array}" var="arr"> Stacktrace: at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366) at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:468) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:378) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722)
2、错误原因
由于在数组中缺少逗号,导致错误发生
String[] array = { "A", "B", "C", "D", "E", "F","G","H","I","J","K","L","M","N" "O","P","Q","R","S","T","U","V","W","X","Y","Z"};
3、解决办法
在“N”后加上逗号
JSP标签c:forEach报错(一)的更多相关文章
- JSP标签c:forEach报错(二)
1.今天,我在用c标签写一些样例,结果出现一些错误,写下作为记录 具体错误如下: 三月 31, 2014 9:46:28 下午 org.apache.catalina.core.StandardWra ...
- jsp使用c:forEach报错 javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext的问题
今天发现了一个折磨我一天的问题: 在jsp文件中使用 <c:forEach items="${checkResult}" var="item"> & ...
- JSP标签c:forEach实例
JSP标签c:forEach实例 1.实例源码 <%@ page language="java" import="java.util.*" pageEnc ...
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>会报错
有些时候,<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>会报错,错 ...
- mybatis foreach报错It was either not specified and/or could not be found for the javaType Type handler
或许是惯性思维,在mybatis使用foreach循环调用的时候,很多时候都是传一个对象,传一个List的情况很少,所以写代码有时候会不注意就用惯性思维方法做了. 今天向sql传参,传了一个List作 ...
- Django 自定义标签与过滤器报错 No module named 'templatetags'
Django 自定义标签与过滤器报错 按照网上的教程如果想使用自定义的标签与过滤器就得往settings.py中添加下列数据 TEMPLATES = [ { 'BACKEND': 'django.te ...
- 【JSP jstl c标签】使用c:foreach 报错(警告)”test does not support runtime expressions“
后台封装的数据是个list,传递给前台,显示如下: <c:forEach items="${userInfo}" var="user"> 用户Nam ...
- jsp动态页面访问报错:HTTP Status 500 - java.lang.NullPointerException,org.apache.jasper.JasperException: java.lang.NullPointerException
今天把项目导入进去一个新的项目中去结果出现了: org.apache.jasper.JasperException: java.lang.NullPointerException 错误,jsp居然访问 ...
- 视图中使用foreach报错问题
问题情境:thinkphp3.2版本,使用四层<foreach></foreach>循环变量时,报错以下错误: syntax error, unexpected 'endfor ...
随机推荐
- Spring 当 @PathVariable 遇上 【. # /】等特殊字符
@PathVariable注解应该不是新鲜东西了Spring3.0就开始有了 URL中通过加占位符把参数传向后台 举个栗子,如下比较要说的内容比较简单就大概齐的写一下 画面侧 $.ajax({ typ ...
- 15_Python函数名本质
函数名的本质 函数名实质上就是函数的内存地址 def wrapper(): pass print(wrapper) 1.引用是什么? 当我们定义a=1的时候,系统会开辟一块内存空间来保存1,然后用a变 ...
- Acrobat 转换pdf到png的另一种方法
此方法效率较低,大概2秒转3页pdf成png图片,但是可以保证图片质量很高,分辨率很高.有优化的地方,但没时间研究.先放代码吧. 前提是安装 acrobat 11(即acrobat xi) CAcro ...
- radare2逆向笔记
最近刚开始学习逆向(Reverse Engineering), 发现其学习曲线也是挺陡峭的, 而网上的 许多writeup文章主旨总结就六个字:"你们看我屌吗?" ...几近炫技而 ...
- Objective-C Runtime 文档翻译
前言 Objective-C语言尽可能多的将许多决定从编译连接推迟到运行时.无论何时,它都尽可能的动态处理事件.这就意味着OC语言不仅仅需要编译器,还需要一个运行时系统来执行编译完成的代码.对于O ...
- rsync推送和拉取
rsync格式: # 拷贝本地文件.当SRC和DES路径信息都不包含有单个冒号":"分隔符时就启动这种工作模式.如:rsync -a /data /backup rsync [OP ...
- BZOJ 1061: [Noi2008]志愿者招募 [单纯形法]
传送门 题意: 长为$n$的序列,第$i$位至少$b_i$,$m$种区间使$[l_i,r_i]+1$代价为$a_i$ 求满足的最小花费 复习单纯形法重做一遍 原始问题$m$个变量$n$个约束,$a_{ ...
- BZOJ 2419: 电阻 [高斯消元 物理]
http://www.lydsy.com/JudgeOnline/problem.php?id=2419 题意: n个点m个电阻构成一张图,求1到n的等效电阻 第一节课看一道题弃疗,于是来做这道物理题 ...
- BZOJ 3992: [SDOI2015]序列统计 [快速数论变换 生成函数 离散对数]
3992: [SDOI2015]序列统计 Time Limit: 30 Sec Memory Limit: 128 MBSubmit: 1017 Solved: 466[Submit][Statu ...
- [LeetCode] 679. 24 Game(回溯法)
传送门 Description You have 4 cards each containing a number from 1 to 9. You need to judge whether the ...