Usage of <%@page session="false" %> in component jsp | Community
Skip to main content
Level 9
November 18, 2015
Solved

Usage of <%@page session="false" %> in component jsp

  • November 18, 2015
  • 3 replies
  • 2558 views

Hi All,

I come from a support background, so answers to couple of questions might be pretty straightforward but since I am not quite clear on them posting all of my doubts here.

In this article https://helpx.adobe.com/experience-manager/using/aem-dam-image-components.html

1]  what exactly is the use of %@page session="false" %. http://www.tutorialspoint.com/jsp/jsp_implicit_objects.htm and http://www.tutorialspoint.com/jsp/jsp_session_tra cking.htm mentions that it is an implicit object in jsp and used for session tra cking. But what kind of session tr acking is done in components in CQ.

2] I have seen sling.getService() used at multiple places. What exactly is the use of this.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by edubey

Yes, right.It comes with sling which is used by AEM.

Take a look @ http://blogs.adobe.com/kmossman/2012/04/osgi-sling-service-example.html

3 replies

edubey
Level 10
November 18, 2015
<%@ page session="false" %>

1. This is httpsession between browser and server not bind to component or AEM but more of JSP, as you will be aware HTTP is stateless

2. You can have services in OSGI, which perform some task or operation. In order to call those services we use sling.getService(), take a look @ https://helpx.adobe.com/experience-manager/using/first-osgi.html

askdctmAuthor
Level 9
November 18, 2015

Hi Edubey,

Thanks a lot for your reply.

So, in this case "SlingRepository slingRep = sling.getService(SlingRepository.class);" , SlingRepository is an OOTB service provided by CQ, which we are making use of,correct?

edubey
edubeyAccepted solution
Level 10
November 18, 2015

Yes, right.It comes with sling which is used by AEM.

Take a look @ http://blogs.adobe.com/kmossman/2012/04/osgi-sling-service-example.html