`
Everyday都不同
  • 浏览: 725138 次
  • 性别: Icon_minigender_1
  • 来自: 宇宙
社区版块
存档分类
最新评论

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

    博客分类:
  • jsp
阅读更多

最近在做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.

2
0
分享到:
评论

相关推荐

    JSqlparser4.4版作者提供的应急版,解决无法解析mysql中JSON_OBJECT函数存在其它函数问题

    如下sql,JSON_OBJECT函数中存在CAST函数,随后...Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "SELECT" at line 18, column 10. Was expecting one of: "!" "(" "NOT

    org.apache.batik包

    Apache Batik是Apache软件基金会开发的一个开源项目,主要用于处理SVG(Scalable Vector Graphics)图形。这个包在Java环境中提供了一整套工具和库,使得开发者可以创建、修改、显示和转换SVG内容。SVG是一种基于XML...

    ShardingSphere笔记(三):自定义分片算法 - 按月分表·真·自动建表

    具体实现时,我们可以自定义一个分片策略类,该类继承自ShardingSphere的`org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm`或`org.apache.shardingsphere.api.sharding.standard....

    commons-jexl-2.0.jar

    &lt;groupId&gt;org.apache.commons &lt;artifactId&gt;commons-jexl &lt;version&gt;2.0 &lt;/dependency&gt;

    java FTP 开发工具包

    org.apache.commons.net.ftp.parser org.apache.commons.net.io org.apache.commons.net.nntp org.apache.commons.net.ntp org.apache.commons.net.pop3 org.apache.commons.net.smtp org.apache.commons.net....

    java调用net开发的webservice实例

    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283) ... 5 more 在...

    scala-parser-combinators_2.12-1.1.0-API文档-中英对照版.zip

    Maven坐标:org.scala-lang.modules:scala-parser-combinators_2.12:1.1.0; 标签:scala、lang、modules、parser、combinators、中英对照文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index....

    Geotools Java API 开发gis的参考资料

    org.geotools.gui.swing.contexttree.column org.geotools.gui.swing.contexttree.node org.geotools.gui.swing.contexttree.popup org.geotools.gui.swing.contexttree.renderer org.geotools.gui.swing....

    tika读取文件专用包

    import org.apache.tika.parser.AutoDetectParser; import org.apache.tika.sax.BodyContentHandler; Tika tika = new Tika(); File file = new File("path_to_your_file"); Metadata metadata = new Metadata...

    scala-parser-combinators-2.11-1.0.4-API文档-中文版.zip

    Maven坐标:org.scala-lang.modules:scala-parser-combinators_2.11:1.0.4; 标签:11、parser、scala、combinators_2、lang、modules、jar包、java、API文档、中文版; 使用方法:解压翻译后的API文档,用浏览器...

    ua-parser-1.3.0.jar.rar

    ua-parser-1.3.0.jar,现在maven中http://maven.twttr.com/ua_parser/ua-parser/1.3.0/ua-parser-1.3.0.pom下载不下来。

    poi读取大文件Excel,使用xml格式解析,速度实测50mb文件13s,可指定sheet页内容,带工具类和测试类

    parser.parse(sheetSource); sheetSource.close(); opcPackage.close(); } } ``` 以上就是关于使用Apache POI的XSSFEventUserModel API解析大文件Excel的关键知识点,以及如何指定读取特定sheet页内容的概述。...

    Druid源码(apache-druid-0.22.1-src.tar.gz)

    Apache Druid 是一个高性能、实时分析数据库,主要用于大数据的在线分析处理。它以其强大的查询性能、低延迟和可扩展性在大数据领域中广受好评。在深入理解Druid之前,我们首先需要了解它作为连接池的角色,以及...

    XMLParser iphone

    parser.parse() // 开始解析 ``` 2. **实现XMLParserDelegate协议**: 为了接收XMLParser解析过程中的事件,你的类需要遵守`XMLParserDelegate`协议,并实现以下关键方法: - `parser(_:didStartElement:...

    如何通过java程序获得Nutch中网页的详细信息

    import org.apache.nutch.parse.Parser; import org.apache.nutch.parse.ParseResult; import org.apache.nutch.segment.SegmentReader; import org.apache.nutch.segment.SegmentReaderFactory; public class ...

    lucene练习代码

    Query query = parser.parse("搜索关键字"); TopDocs topDocs = searcher.search(query, 10); // 返回前10个结果 for (ScoreDoc scoreDoc : topDocs.scoreDocs) { Document doc = searcher.doc(scoreDoc.doc); ...

    lucene简单代码列子

    Query query = parser.parse("Lucene 简单 代码"); TopDocs docs = searcher.search(query, 10); // 搜索前10个匹配的文档 for (ScoreDoc scoreDoc : docs.scoreDocs) { Document doc = searcher.doc(scoreDoc....

    Lucene之Helloworld

    Query query = parser.parse("Lucene"); // 解析查询字符串 TopDocs topDocs = searcher.search(query, 10); // 执行查询,返回前10个结果 for (ScoreDoc scoreDoc : topDocs.scoreDocs) { Document doc = ...

    xfire与cxf包冲突解决方法

    org.codehaus.xfire.wsdl11.parser.SchemaInfo org.codehaus.xfire.wsdl11.parser.WSDLServiceBuilder org.codehaus.xfire.wsdl11.parser.WSDLServiceConfigurator org.codehaus.xfire.wsdl11.parser....

    Lucene中文分词组件 JE-Analysis 1.4.0

    Query query = parser.parse("印度尼西亚 6.2级地震");//检索词 Hits hits = isearcher.search(query); System.out.println("命中:" + hits.length()); for (int i = 0; i &lt; hits.length(); i++) { ...

Global site tag (gtag.js) - Google Analytics