How to invoke another OSGI bundle servlet from different OSGI bundle? | Community
Skip to main content
October 16, 2015
Solved

How to invoke another OSGI bundle servlet from different OSGI bundle?

  • October 16, 2015
  • 11 replies
  • 3378 views

Hi there,

i just wondering How to invoke another OSGI bundle servlet from different OSGI bundle?

 

Thanks a lot.

Best regards,

Brian

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 smacdonald2008

I got this use case to work. The following pic shows an AEM web page that displays data returned from a Sling Servlet (the Sling Servlet invoked by an AEM Service):

[img]SlingInvoke.png[/img]

Here is the community article that steps you through this use case:

https://helpx.adobe.com/experience-manager/using/HttpClient_AEM.html

Only use this use case if you have to invoke a servlet from a service. It better to invoke the servlet from a web page using AJAX - as talked about here:

http://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html

11 replies

Level 3
October 16, 2015

Servlets are registered services in OSGi so you can access it just like a service. If you have shared logic, its probably better to move that code into a class you can define as an OSGi service.