包未定义 [英] Packages not defined
本文介绍了包未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我用javascript编写了一个脚本,并在规则中使用了它(共享)。脚本开始于:
i wrote a script in javascript and used it in rules (share). The script start with:
var ctx = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
我遇到一个错误,告诉我参考错误:未定义软件包。
I m getting an error telling me that "Reference error: Packages is not defined".
我该如何解决这个问题?
How can i solve this issue?
推荐答案
Packages
对象仅适用于被认为安全的代码。这很可能失败,因为代码来自存储库/数据字典中的节点。将其放在类路径中的某个位置(例如 classes / alfresco / templates / webscripts /...
)。
The Packages
object is only available for code which is considered "secure". This is most likely failing because the code is from a node in the Repository/Data-Dictionary. Put it somewhere in the classpath (e.g. classes/alfresco/templates/webscripts/...
).
这篇关于包未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文