1

我正在发送地图并在速度模板版本 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)
4

1 回答 1

1

the expcetion is caused by velocity versions only.

Use apache velocity version 1.6.2 or later versions.

Maven dependency

<dependency>
                <groupId>org.apache.velocity</groupId>
                <artifactId>velocity</artifactId>
                <version>1.6.2</version>
            </dependency>
于 2013-03-05T09:11:39.017 回答