필터 :@Reference 내가 서블릿 필터를 쓰고 있어요 및 @Reference 사용하여 내을 Liferay 구성 요소 중 하나를 사용하고 싶습니다
package my.filter;
import my.Compo;
import org.osgi.service.component.annotations.Reference;
public class MyFilter implements Filter {
@Override
public void doFilter(...) {
compo.doTheThing();
}
@Reference(unbind = "-")
protected my.Compo compo;
}
을 나는이 자바 컴파일 오류 얻을 :
annotation type not applicable to this kind of declaration
무엇 내가 틀렸어?
이것을 달성하는 것이 불가능할 수도 있습니까?
1. \ @Reference는 osgi \ @Components 외부에서 사용할 수 없습니다. 2.이 종속성을 정의 했습니까 ogr.osgi : org.osgi.service.component.annotations : 1.3.0 –