April 10, 2020
Estimated Post Reading Time ~

How to retrieve OSGi Configurations?

Scenario: How to retrieve configuration details in jsp/class ?

Solutions:
@Reference
ConfigurationAdmin configAdmin;

Configuration config = configAdmin.getConfiguration("com.day.cq.mailer.DefaultMailService");

Dictionary<?, ?> d = config.getProperties();
log.debug("Configurations Dictionary:{}"+d);

String hostName= (String) d.get("smtp.host");


By aem4beginner

No comments:

Post a Comment

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