我发送地图并访问速度模板版本1.2但我试图在vm中创建地图我无法创建并获得异常。请给你指导。
#set($buyerActionStat = {
"0":"New",
"5":"Response-Acknowledged",
"6":"Response-Accepted",
"7":"Response-Rejected"
})
例外:
org.apache.velocity.exception.ParseErrorException: Lexical error: org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 5, column 25. Encountered: "{" (123), after : ""
at org.apache.velocity.Template.process(Template.java:181)
at org.apache.velocity.runtime.resource.ResourceManager.getResource(ResourceManager.java:327)
at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:736)
at org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.java:355)
at org.apache.velocity.app.Velocity.getTemplate(Velocity.java:533)
at ecnet.rd.core.template.TemplateResolver.<init>(TemplateResolver.java:45)
at ecnet.rd.core.template.TemplateResolver.getInstance(TemplateResolver.java:34)
at ecnet.rd.helper.AMECPOHelper.mergePOTemplate(AMECPOHelper.java:71)
答案 0 :(得分:1)
异常仅由速度版本引起。
使用apache velocity
版本1.6.2
或更高版本。
Maven依赖
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.6.2</version>
</dependency>