Questions tagged [sling]

Apache Sling is a web framework that uses Java Content Repository to store and manage content. It also uses OSGi (Apache Felix) for dynamic loading.

Description

Apache Sling is a web framework that uses a Java Content Repository , such as Apache Jackrabbit , to store and manage content.

Sling applications use either scripts or Java servlets, selected based on simple name conventions, to process HTTP requests in a RESTful way.

The embedded Apache Felix OSGi framework and console provide a dynamic runtime environment, where code and content bundles can be loaded, unloaded and reconfigured at runtime.

As the first web framework dedicated to JSR-170 Java Content Repositories, Sling makes it very simple to implement simple applications, while providing an enterprise-level framework for more complex applications.

Links

863 questions
5
votes
1 answer

Sling resource vs nodes

I'm having trouble understanding why you would use resources instead of nodes in sling. So say I have something simple accessing nodes like below: NodeIterator headerNode = currentNode.getNodes(); //loop through and do something with the nodes. How…
Delmon Young
  • 2,013
  • 5
  • 39
  • 51
4
votes
2 answers

What is the lifecycle of a jsp PageContext object - is it threadsafe?

Are jsp PageContext objects created and destroyed as part of the http request-response cycle or are they cached and reused between requests. PageContext has life-cycle methods that suggest reuse between requests. ie initialize(), release(). If they…
murungu
  • 2,090
  • 4
  • 21
  • 45
4
votes
1 answer

What is the @Service annotation in Apache Felix?

I've read several articles about the difference between @Service and @Component. Now I understand that @Component is user to annotate an object as an OSGi component and its lifecycle will then be managed by OSGi. However, what is the need to declare…
Vishal--JAVA--CQ
  • 188
  • 1
  • 2
  • 18
4
votes
1 answer

transient Service @Reference in Sling Servlet

I have a couple of Sling servlets in a project (implementing SlingAllMethodsServlet or SlingSafeMethodsServlet), and some of them reference Sling services: public class MyServlet extends SlingAllMethodsServlet{ @Reference private…
4
votes
1 answer

How is sling:resourceSuperType is impacting sling resolution?

Hi was going through the how sling resolution works. I came against this scenario which is mentioned on Adobe aem-developer guide https://docs.adobe.com/docs/en/aem/6-2/develop/the-basics.html This is the scenario which is mentioned- / a ( does…
Ngupta
  • 319
  • 4
  • 19
4
votes
2 answers

Why we extends WCMUsePojo class while working with AEM?

Why we extends WCMUsepojo abstract class in our program while working with AEM? What is the advantage of using this class?
Rashid
  • 343
  • 4
  • 14
4
votes
1 answer

How to use/understand AEM Sling Resource Merger, override and Overlay concepts

Am trying to understand the AEM Sling Resource Merger concept. As per the Adobe docs examples Override (Configuring your Page Properties), Overlay (Customizing the Consoles (touch-optimized UI)) am getting confused how to use this, can any one…
krish
  • 469
  • 1
  • 15
  • 34
4
votes
1 answer

RuntimeException: Unable to scan input when loading a page in AEM

One of the most commonly used pages in our AEM application stopped working today and every time it's requested, the following (or very similar) entry appears in the error log: *ERROR* [127.0.0.1 [1460623324684] GET…
toniedzwiedz
  • 17,895
  • 9
  • 86
  • 131
4
votes
1 answer

Overcoming the 1000+ node limit for cq:Page nodes in AEM 6.1

We are currently building a large site using AEM 6.1 and will be migrating hundreds of thousands of records from an old RDMS-based system to AEM's JCR. We understand that the 1000+ node limitation does not apply to nodes with type nt:unstructured,…
JStarcher
  • 144
  • 1
  • 5
4
votes
1 answer

How to use Items Load Path in dropdown list of AEM Form

While creating a dropdown list in my form I noticed a field called "Items Load Path". Can this field be used to provide a url from which it loads the options available in a dropdown list? Where would the URL reside, and how can I put values in that…
birdy
  • 9,286
  • 24
  • 107
  • 171
4
votes
2 answers

Display different markup in Sightly based on a Sling selector

The context I'm working on an AEM 6 project that uses Sightly as the templating language. I'm facing a use case, in which I want to show or hide certain parts of the markup depending on the presence of a Sling selector. For example, a request to…
toniedzwiedz
  • 17,895
  • 9
  • 86
  • 131
4
votes
2 answers

Debugging Sling/Sightly server-side JavaScript

I am trying to debug JavaScript that is stored in the JCR and run on the server with Rhino, by the Sightly templating language's JavaScript UseAPI. As per the instructions provided in sling.properties: # To enable the current server side debugging…
Alasdair McLeay
  • 2,572
  • 4
  • 27
  • 50
4
votes
3 answers

CQ5 component afteredit

I created a sling servlet skeleton like so... @SlingServlet(paths = "/bin/foo/bar", methods = "POST") public class FooBarServlet extends SlingAllMethodsServlet { private final Logger LOGGER = LoggerFactory.getLogger(this.getClass()); …
Juan Ayala
  • 3,388
  • 2
  • 19
  • 24
4
votes
3 answers

Cannot get/set data from sling models

We have sling model. For example @Model(adaptables=Resource.class) public class MyModel { @Inject private String propertyName; } public Image getPropertyName) { return propertyName; } Also we have added
MastAvalons
  • 1,150
  • 1
  • 14
  • 23
4
votes
1 answer

How to add additional element to htmlparser generator

I want to rewrite links in attributes of span tags with sling rewrite pipeline. The htmlparser generator only calls "a, link, script, img, form, body" elements. How can I add additional element like span to my transformer? An example configuration…
nerd
  • 837
  • 6
  • 21