sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konrad Windszus (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SLING-6637) [htl] data-sly-use should not raise an exception when resource doesn't exist
Date Thu, 23 Mar 2017 13:11:41 GMT

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

Konrad Windszus commented on SLING-6637:
----------------------------------------

Non existing properties used in EL don't throw exceptions because
a) that is explicitly defined for HTL EL
b) is in line with JSP EL
Also this is one of the fundamental differences between EL and block statements.

If we wouldn't throw an explicit exception for {{data-sly-use}} then a a developer's typo
like {{data-sly-use.logo=org.apache.slign.MyModel}} would be much harder to detect, because
the HTL rendering would continue and you just would get back the empty result for every operation
on {{logo}}.

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

Mime
View raw message