The session can be easily accessed in the sling model by using the Sling Object annotation. Below code helps us achieve it.
@SlingObject
private ResourceResolver resourceResolver
resourceResolver.adaptTo(Session.class)
@SlingObject
private ResourceResolver resourceResolver
resourceResolver.adaptTo(Session.class)
No comments:
Post a Comment