私はAEM 5.6.1で実行する単純なSlingフィルタを作成しています。私はフィルタに設定プロパティを使用させました、そして、私はそれが/ system/console/configMgrに表示されることを期待していましたが、そうではありません。私はバンドルをインストールすることができるよApache FelixへのSlingFilterの追加configMgr
@SlingFilter(generateComponent = true, generateService = true, order = -700, scope = SlingFilterScope.REQUEST)
public class SimpleFilter implements Filter {
@Property(value = "property.defaultvalue")
private static final String PROPERTY_KEY = "property.key";
private String configuredValue;
@Activate
protected void activate(final ComponentContext componentContext) throws Exception {
Map<String, String> config = (Map<String, String>) componentContext.getProperties();
this.configuredValue = config.get(PROPERTY_KEY);
}
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
System.out.println(this.configuredValue);
}
}
は、フィルタが動作していると/システム/コンソール/バンドルでそれを見つけることができることがわかり、それは私のように/システム/コンソール/ ConfigMgrのに追加されません。それが@Propertyアノテーションの存在から考えていました。私は一歩足りなかった?