【问题标题】:Getting an error while writing a custom velocity macro编写自定义速度宏时出错
【发布时间】:2012-03-10 21:51:24
【问题描述】:

在创建我自己的宏并尝试添加它以便任何人都可以使用它时,我收到以下错误:

Error number 4001 in 4: Error while parsing velocity page /templates/docdoesnotexist.vm 

包装异常:无法启动 Velocity 引擎

我没有更改该文件,但我通过分别添加recentChanges=velocity:recentChanges:#macro(recentChanges) 来更改xwiki/templates/macros.txt/macros.vm(是的,我确实在#macro(recentChanges) 之后添加了工作内容)

【问题讨论】:

    标签: macros velocity xwiki


    【解决方案1】:

    这看起来像是 macros.vm 中的语法错误。您应该恢复到原始的 macros.vm 并首先尝试在 wiki 页面中编写您的自定义宏。成功后,您可以将其移至 macros.vm 并重新启动服务器。

    不应编辑macros.txt,它是旧版所见即所得编辑器使用的遗留文件。

    【讨论】:

    • 还是不行。从macros.txt和.vm中删除了添加,重新启动服务器>>作品在wikipage中创建宏>>作品复制宏将宏添加到macros.vm(#macro(recent_changes)代码在这里插入不再起作用>>这次查看。虚拟机
    猜你喜欢
    • 2019-04-07
    • 2019-07-21
    • 1970-01-01
    • 1970-01-01
    • 2011-03-08
    • 1970-01-01
    • 1970-01-01
    • 2016-02-16
    • 1970-01-01
    相关资源
    最近更新 更多