[
https://issues.apache.org/jira/browse/SLING-6637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15938280#comment-15938280
]
Konrad Windszus commented on SLING-6637:
----------------------------------------
your example
{code}
<sly data-sly-use.x="${ 'x/y/z' }"/>
{code}
is equivalent to
{code}
<sly data-sly-use.x="x/y/z"/>
{code}
(You should not use EL for just literals, compare also with
https://github.com/Netcentric/aem-htl-style-guide#3.3)
So EL does not fail here at all.
While for
{code}
data-sly-test.x="${ prop.x }"
{code}
The EL will actually return the empty string (which will be converted then to a
boolean). So the block statement is totally fine (and must not throw an
exception)
> [htl] data-sly-use should not raise an exception when resource doesn't exist
> ----------------------------------------------------------------------------
>
> Key: SLING-6637
> URL: https://issues.apache.org/jira/browse/SLING-6637
> Project: Sling
> Issue Type: Bug
> Components: Scripting
> Reporter: Feike Visser
> Assignee: Radu Cotescu
>
> Following code:
> {code}
> <sly data-sly-use.x="${ 'x/y/z' }"/>
> {code}
> You get now the following exception:
> {code}
> org.apache.sling.scripting.sightly.SightlyException: No use provider could
> resolve identifier x/y/z
> {code}
> In practice you want to have a null-value assigned to x, now developers will
> make a lot of checks to make sure the resource does exist.
> In addition we can log warning message when this happens.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)