Expand my Community achievements bar.

Bunndle configuration

Avatar

Level 3

Hi guys

I created htmlfilter servlet ,this servlet  how to htmlfilter can be disabled by the bundle configuration: enable.htmlfilter.filter {Boolean}smacdonald2008kautuksahnitim-schwalbeJörg Hohdgordon86Woojinclawsonmghalpin

7 Replies

Avatar

Employee Advisor

Hi,

The question is unclear to me, maybe you can confirm if I understood it correctly: You have written a servlet, and you want to be able to enable or disable the servlet via OSGI configuration. Is that correct?

The easiest way is to set ConfigurationPolicy to REQUIRED. This ensures that as soon as a OSGI configuration is present the servlet is being instantiated. If there is no OSGI configuration present the servlet is not active (not instantiated).

See acs-aem-samples/SampleOsgiR6AnnotationsImpl.java at master · Adobe-Consulting-Services/acs-aem-sampl...  for an example how to do with OSGI annotations.

Jörg

Avatar

Level 3

yes what you said,, but it is boolean ,if it is true servlet eanble or dasable..

i followed u shared link but component is not visible in felix console

Avatar

Employee Advisor

If the component is not visible, you haven't created a configuration for it. If you use the approach I described above (using ConfigurationPolicy) you cannot use the OSGI webconsole to do it, but you need to create an OSGI configuration in the repository. And if that configuration exists (and only then), the component will be started.

Jörg

Avatar

Level 2

This is not a comment about the Forums, and this thread needs to be moved from Forum Comments to the correct forum. Which Adobe software is it about?

Avatar

Level 3

Actually this is requirement

Create an HTML filtering filter as part of the publish tools bundle.

The filter can be disabled by the bundle configuration: enable.htmlfilter.filter {Boolean}

The filter must be disabled by default.