April 10, 2020
Estimated Post Reading Time ~ < 1 Min

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");
aem4beginner.blogspot


By aem4beginner

No comments:

Post a Comment

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

Ad Blocker Detected :(

Please consider supporting us by disabling your ad blocker.

Please Disable your adblocker and Refresh the page to view the site content.