当前位置:首页 > 开发 > 系统架构 > Apache > 正文

org.apache.el.parser.ParseException: Encountered " ":" ": "" at line 1, column 1

发表于: 2015-05-29   作者:Everyday都不同   来源:转载   浏览:
摘要: 最近在做Highcharts的过程中,在写js时,出现了以下异常:   严重: Servlet.service() for servlet jsp threw exception org.apache.el.parser.ParseException: Encountered " ":" ": "" at line 1,

最近在做Highcharts的过程中,在写js时,出现了以下异常:

 

严重: Servlet.service() for servlet jsp threw exception

org.apache.el.parser.ParseException: Encountered " ":" ": "" at line 1, column 10.

Was expecting one of:

    "}" ...

    "." ...

    "[" ...

    ">" ...

    "gt" ...

    "<" ...

    "lt" ...

    ">=" ...

    "ge" ...

    "<=" ...

    "le" ...

    "==" ...

    "eq" ...

    "!=" ...

    "ne" ...

    "&&" ...

    "and" ...

    "||" ...

    "or" ...

    "*" ...

    "+" ...

    "-" ...

    "/" ...

    "div" ...

    "%" ...

    "mod" ...

    

at org.apache.el.parser.ELParser.generateParseException(ELParser.java:2142)

at org.apache.el.parser.ELParser.jj_consume_token(ELParser.java:2024)

at org.apache.el.parser.ELParser.DynamicExpression(ELParser.java:147)

at org.apache.el.parser.ELParser.CompositeExpression(ELParser.java:43)

at org.apache.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:114)

at org.apache.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:172)

at org.apache.el.lang.ExpressionBuilder.createValueExpression(ExpressionBuilder.java:216)

at org.apache.el.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:68)

at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:937)

at org.apache.jsp.page.M5.M5006_jsp._jspService(M5006_jsp.java:514)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at com.kayak.web.user.filter.LoginCertifyFilter.doFilter(LoginCertifyFilter.java:123)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at com.kayak.web.base.filter.LocalRequestFilter.doFilter(LocalRequestFilter.java:27)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)

at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

at java.lang.Thread.run(Thread.java:745)

 

这是加载页面时报的错,按异常来看,应该跟el表达式脱不了干系。而注意到由该jsp页面生成的servlet类里报的错误行数(如红色部分所示)。在tomcat中打开该行,发现:

 

out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${point.y:,.0f}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));

 会发现,跟$符号有关!其实,本意是在页面上直接显示$符号,表示美元符号,而并不想赋予它el表达式的含义。——这也是为啥我单独把该页面抽出来,不放在web环境,也就没经过tomcat。页面能正常显示的原因。

 

解决办法:加上转义符:

pointFormat: '<span style="color:{series.color}">{series.name}: <b>\${point.y:,.0f}</b><br>'

 其中\$即把$当成单纯的美元符使用。如果不转义,el的$根本无法解析point.y:,.0f !!

 

-------------------------------------------------------------------------------

附:

1.为了不让charts显示导出的menu

exporting: {
	 	    	   buttons:{
	 	    		   contextButton:{
	 	    			   enabled:false
	 	    		   }
	 	    	   }
	   }

 如果直接这样写:exporting : null 则会报错:can not read property 'buttons' of null(可通过查阅highcharts的API,其中有exporting 属性,即可知道原因。)

 

2.Uncaught Highcharts error #14: www.highcharts.com/errors/14

造成这个原因一般都是Highcharts的series里格式错误或者addPoint操作时格式错误,有时候你的数据来源是由后台加载,就必须注意通过aJax返回到前台的数据,必须是number(int float double等)的数据,而不是String.

org.apache.el.parser.ParseException: Encountered " ":" ": "" at line 1, column 1

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

编辑推荐
想编辑一下gnome的菜单栏,结果出现了这样的错误: google了一把,发现只要解决就可以了: 写道 rm
想编辑一下gnome的菜单栏,结果出现了这样的错误: google了一把,发现只要解决就可以了: 写道 rm
“Hi Insus.NET, 我有参考你下午发布的一篇《jQuery.Ajax()执行WCF Service的方法》http://www.cnbl
mantis bug管理系统的二次asp.net 接口开发的时候,碰到编码的问题,如上述标题。 此系统的功能比较
在使用Navicat for MySQL还原数据库备份时,出现Incorrect integer value: '' for column 'id' at r
在使用Navicat for MySQL还原数据库备份时,出现Incorrect integer value: '' for column 'id' at r
【项目说明】 在做网上商城的项目的时候,向数据库中插入数据插不进去,显示pdate(pdate为上传商品
今天准备优化一个项目的查询。欲在创建帐号的存储过程中增加一个日期索引,在执行该存储过程时发现
// #include <math.h> void DrawDashLine(CDC* pDC, LPPOINT ptStart, LPPOINT ptEnd, int nW
<mx:LineChart id="linechart" color="0x323232" width="100%" height="100%" showDataTips="tru
版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号