You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Ben Fortuna (JIRA)" <ji...@apache.org> on 2019/07/11 07:39:00 UTC

[jira] [Comment Edited] (SLING-8562) Unable to resolve ESP scripts loaded from Filesystem Resource Provider

    [ https://issues.apache.org/jira/browse/SLING-8562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16882506#comment-16882506 ] 

Ben Fortuna edited comment on SLING-8562 at 7/11/19 7:38 AM:
-------------------------------------------------------------

Hi Robert, I've confirmed that HTL (and thymeleaf, groovy) script processing aren't affected by this issue, haven't tried JSP yet.

Definitely appears to be a rhino script binding issue, but unclear if the problem is with fs resource or with scripting (javascript).


was (Author: fortuna):
Hi Robert, I've confirmed that HTL (and thymeleaf, groovy) script processing aren't affected by this issue, haven't tried JSP yet.

Definitely appears to be a rhino script binding issue, but unclear if the problem is with fs resource or with scripting core.

> Unable to resolve ESP scripts loaded from Filesystem Resource Provider
> ----------------------------------------------------------------------
>
>                 Key: SLING-8562
>                 URL: https://issues.apache.org/jira/browse/SLING-8562
>             Project: Sling
>          Issue Type: Bug
>    Affects Versions: Scripting Core 2.0.46, File System Resource Provider 2.1.16
>            Reporter: Ben Fortuna
>            Priority: Major
>
> A simple test fails when trying to load a resource via Sling Filesystem Resource Provider.
> /content/sample/index.json:
> {code:java}
> {
>   "sling:resourceType": "sample/page/index",
>   "jcr:primaryType": "nt:unstructured",
>   "title": "Sample App"
> }{code}
>  
> /apps/sample/page/index/html.esp:
> {code:java}
> <html>
> <head><title>${currentNode.title}</title></head>
> <body></body>
> </html>{code}
>  
> When both content and app are mounted via Filesystem Resource Provider config the following error results:
> {code:java}
> Internal Server Error (500)
> Exception:
> java.lang.UnsupportedOperationException
>   at org.apache.sling.fsprovider.internal.mapper.jcr.FsNode.getNodes(FsNode.java:517)
>   at org.apache.sling.scripting.javascript.wrapper.ScriptableNode.get(ScriptableNode.java:319)
> ...{code}
>  
> Basically the javascript renderer tries to call `Node.getNodes(pattern)` to resolve the property `currentNode.title` but Filesystem Resource Provider doesnt support this method.
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)