未定义的包

编程入门 行业动态 更新时间:2024-10-25 20:24:17
本文介绍了未定义的包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我用 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/...).

更多推荐

未定义的包

本文发布于:2023-11-28 13:27:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1642593.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:未定义

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!