You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2018/03/08 09:43:00 UTC

[jira] [Commented] (SLING-6636) Add request-attributes to SlingHttpServletRequest

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

Carsten Ziegeler commented on SLING-6636:
-----------------------------------------

[~fvisser] I'm not sure if we should add such a method in the API. There are other objects with similar patterns, so how about solving this in Sightly by
 * it first looks for getAttributes
 * if that is not found it looks for getAttribute(String)

So basically if the direct mapped method is not available and the name ends with an "s" try to find such a method. Then this works for all objects using that pattern and doesn't require us to enhance the api (which in turn might break things like mock impls because of the missing method)

> Add request-attributes to SlingHttpServletRequest
> -------------------------------------------------
>
>                 Key: SLING-6636
>                 URL: https://issues.apache.org/jira/browse/SLING-6636
>             Project: Sling
>          Issue Type: Improvement
>          Components: API
>            Reporter: Feike Visser
>            Priority: Major
>
> With https://issues.apache.org/jira/browse/SLING-5812 you can now pass in request-attributes. Still you can not access them directly in Sightly.
> It would be great to access them like
> ${request.attributes['layout']}
> Adding a List<String,Object> to SlingHttpServletRequest might be the best.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)