本文介绍了未定义的包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我用 javascript 编写了一个脚本并在规则中使用它(共享).脚本开始于:
i wrote a script in javascript and used it in rules (share). The script start with:
var ctx = Packages.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/...).
更多推荐
未定义的包
发布评论