groovy简单模板引擎尺寸太大

时间:2017-01-15 11:31:09

标签: grails groovy

只是一个简单的问题。我可以使用更新的groovy版本运行grails 2.3.5吗?

看起来我的groovy版本没有

groovy.text.SteamingTemplateEngine

目前我正在使用

groovy.text.SimpleTemplateEngine

但我正在达到SimpleTemplateEngine的大小限制,我正在寻找一种解决方法。

这是我得到的错误:

    at grails.plugin.jms.listener.adapter.PersistenceContextAwareListenerAdapter.invokeListenerMethod(PersistenceContextAwareListenerAdapter.groovy:44)
    at grails.plugin.jms.listener.adapter.LoggingListenerAdapter.onMessage(LoggingListenerAdapter.groovy:48)
    at grails.plugin.jms.listener.adapter.PersistenceContextAwareListenerAdapter.onMessage(PersistenceContextAwareListenerAdapter.groovy:33)
    at java.lang.Thread.run(Thread.java:745)
Caused by: groovy.lang.GroovyRuntimeException: Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed:
SimpleTemplateScript7.groovy: 1: String too long. The given string is 575915 Unicode code units long, but only a maximum of 65535 is allowed.
 @ line 1, column 11.

如果有人提出解决方案的建议,那就太棒了。感谢

2 个答案:

答案 0 :(得分:0)

最新版本的groovy可以使用Grails 2.3.5是Groovy 2.1.9

请参阅相关的link

自Groovy 2.4.8以来Template Engine存在

您应该考虑升级Grails版本。如果您这样做,请阅读 Grails X.X中的新功能,以确保您没有违反应用程序的当前行为。

答案 1 :(得分:0)

之前已经讨论过(并回答过)。 “解决方法”是在GSP中添加注释以分解脚本块大小,如下所示:

<% 
  // just a comment 
%>
相关问题