我正在尝试通过 Sightly 模板语言的 JavaScript UseAPI 调试存储在 JCR 中并在带有 Rhino 的服务器上运行的 JavaScript。 .
按照 sling.properties 中提供的说明:
# To enable the current server side debugging in the Rhino interpreter
# set the org.apache.sling.scripting.javascript.debug property to true.
# This will open a Swing window for Rhino JavaScript debugging on the
# server platform.
当我这样做时,我可以看到 Rhino 的 Swing 窗口。但是,如果我尝试在 JavaScript 文件上设置断点,或者通过添加
debugger;
来触发调试器行,调试器中断但没有向我显示正确的文件。同样,如果我从 Debug 菜单中选择“Break on function enter”,调试器将中断,但使用“Step Into/Over/Out”似乎会跳转到代码中的随机点。
这对其他人有用吗?我正在使用 org.apache.sling.scripting.javascript 的 v2.0.14,这似乎是最新的。
最佳答案
正如您在其中一条评论中已经提到的那样,此功能似乎尚未真正实现。
Here在主要的 Sightly 文档中,他们列出了以下内容 连接 用于在 Java Use API 上使用 javascript Use API:
no debugger (yet)
关于rhino - 调试 Sling/Sightly 服务器端 JavaScript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27927669/