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

Feike Visser edited comment on SLING-6637 at 3/23/17 12:42 PM:
---------------------------------------------------------------

There is a difference between resolving a Java-class or a resource. A 
Java-class is a static resource that must be available.
While resolving a resource is done at runtime, and a particular path may not 
exist anymore.

What I want to avoid is that developers need to call/write code to check if a 
resource exists, before using data-sly-use.
>From developer standpoint (not implementation standpoint) there is no 
>difference between
{code}
data-sly-test.x="${ wrongVar.wrongField}"
{code}
and
{code}
data-sly-use.x="${ properties.wrongPath }"
{code}

It should both return an empty response that can be checked later.


was (Author: fvisser):
There is a difference between resolving a Java-class or a resource. A 
Java-class is a static resource that must be available.
While resolving a resource is done at runtime, and a particular path may not 
exist anymore.

What I want to avoid is that developers need to call/write code to check if a 
resource exists, before using data-sly-use.
>From developer standpoint (not implementation standpoint) there is no 
>difference between
{code}
data-sly-test.x="${ wrongVar.wrongField}"
{code}
and
{code|
data-sly-use.x="${ properties.wrongPath }"
{code}

It should both return an empty response that can be checked later.

> [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)

Reply via email to