1 Answers
How to Read a Property from OSGi Configuration in AEM 6.1 in a WCMUse Class
When developing in AEM 6.1, you may need to read properties from the OSGi configuration in a WCMUse class. Follow the steps below to accomplish this:
- Inject the OSGi configuration service in the WCMUse class by using the @Reference annotation.
- Access the configuration properties using the Configuration object obtained from the configuration service.
- Read the specific property value using the getProperty() method of the Configuration object.
- Handle null or default values if necessary for robustness.
By following these steps, you can effectively read properties from the OSGi configuration in AEM 6.1 within a WCMUse class, ensuring a seamless development process.
Please login or Register to submit your answer