Expand my Community achievements bar.

SOLVED

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

Avatar

Level 9

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.

1 Accepted Solution

Avatar

Correct answer by
Level 10

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

View solution in original post

3 Replies

Avatar

Level 10
<%@ 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

Avatar

Level 9

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?

Avatar

Correct answer by
Level 10

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