未定义的包 [英] Packages not defined

查看:18
本文介绍了未定义的包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆