How to display “hello world” in CQ5 using osgi


I need to learn how the code flows between sling and Felix in CQ5. I am looking for a basic operation in which my jcr node /jsp will display "Hello World". BUT this message should come from an OSGi bundle.

Basically, I need to create and install the bundle too. But at least I need to know the flow of control here.

Can someone please help on this


You can also do the same thing from servlet too.This way you get a basic Idea of using Sling servlet with CQ as well.

you can call a sling sevlet bundled as OSGI bundle and deployed in CQ's system console. later you can call, this OSGI bundle fire a post request and you will be able to get the response. here is a very nice and very explanatory tutorial that explain every and each steps.

and the sample code or sample application link can be found from here -

follow the above link step by step and you end up with the victory.

This video can help you solving your question :)
By: admin