Pages

Thursday, January 10, 2013

Gotchya! My OSGI bundle is not displaying the edit button to configure settings

The Problem

Your newly minted custom OSGI bundle is using annotations for configurable properties, but there is no edit button visible to edit your properties in the Felix Config Console.

The Solution

In your @Component or @SlingServlet or similar annotation, you need to set  metatype=true for the edit settings to appear. 

Before:
@Property(name="MY-PROPERTY", description="", value="http://www.google.com")

After:
@Property(name="MY-PROPERTY", description="", value="http://www.google.com", metatype=true)

To see the setting in flight, take a look at my other blog post on how to write a custom SlingServlet here.




No comments:

Post a Comment