April 27, 2020
Estimated Post Reading Time ~

How to Retrieve/Update the configuration details through Configuration Admin Service - AEM

This post will explain how to Retrieve/Update the configuration details through Configuration Admin Service in AEM

Java API

//Add the reference
@Reference
org.osgi.service.cm.ConfigurationAdmin configAdmin;

//Reterive/Update the configration

org.osgi.service.cm.Configuration config = configAdmin.getConfiguration("com.day.cq.mailer.DefaultMailService");
Dictionary d = config.getProperties();
String fromAddress=(String)d.get("from.address");
d.put("from.address", "albin.issac1@gmail.com");
config.update(d);


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.