使用JFinal的模板引擎,参数中带有$字符就会报错,应该如何转义?@Jfinal
参数事例:
#(qualificationDetail.qual_role$dicText)
报错信息:
Caused by: com.jfinal.template.stat.ParseException: # parameter exists illegal char: '$'
Template: "/WEB-INF/views/business/qualification/preview.html". Line: 119
at com.jfinal.template.stat.Lexer.scanPara(Lexer.java:278)
at com.jfinal.template.stat.Lexer.scanDire(Lexer.java:110)
at com.jfinal.template.stat.Lexer.scan(Lexer.java:60)
at com.jfinal.template.stat.Parser.parse(Parser.java:89)
at com.jfinal.template.Engine.buildTemplateBySourceFactory(Engine.java:157)
at com.jfinal.template.Engine.getTemplate(Engine.java:142)
at com.jfinal.render.TemplateRender.render(TemplateRender.java:60)
#(qualificationDetail.get("qual_role$dicText"))
再例如:
#(qualificationDetail["qual_role$dicText"])
参考文档,选择合适的用法即可:
https://www.jfinal.com/doc/6-3