2013-03-05 54 views
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) 
+0

你做了什麼異常? – NPKR 2013-03-05 09:03:11

+0

感謝您的回覆剛剛更新了問題。 – sunleo 2013-03-05 09:06:06

回答

1

的expcetion僅由速度版本引起的。

使用apache velocity版本1.6.2或更高版本。

Maven的依賴

<dependency> 
       <groupId>org.apache.velocity</groupId> 
       <artifactId>velocity</artifactId> 
       <version>1.6.2</version> 
      </dependency> 
+0

感謝您的幫助@npkr – sunleo 2013-03-06 06:09:50