How to set values in an osgi configuration through servlet | Community
Skip to main content
Level 4
June 28, 2022
Solved

How to set values in an osgi configuration through servlet

  • June 28, 2022
  • 2 replies
  • 1367 views

I am using AEM as a Cloud Service. And in that I'm extending tools menu so that osgi configurations can be set through that. I want to set a specific configuration values through that and for that I will be using servlet. So, using servlet how can I set the already existing osgi configuration values ?

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

2 replies

DEBAL_DAS
New Member
June 28, 2022

You could refer https://aem4beginner.blogspot.com/programmatically-updating-osgi and please focus on OsgiConfigExamplServlet.java.

 

In your servlet you need to inject ConfigurationAdmin service and by using 

Configuration getConfiguration(java.lang.String pid)

you will be able to read specific OSGi configuration , here pid represents that specific OSGi configuration. 

Debal Das, Senior AEM Consultant
Bhuwan_B
Community Advisor
Bhuwan_BCommunity AdvisorAccepted solution
Community Advisor
June 28, 2022