我正在嘗試執行FIQL搜索查詢,我正在按照指南http://cxf.apache.org/docs/jax-rs-advanced-features.html#JAX-RSAdvancedFeatures-FIQLsearchqueries。如何在Apache CXF中使用FIQL查詢時注入@Context - JAX-RS?
問題是SearchContext始終爲空,我在運行時收到NullPointerException。
我的示例代碼:
@Context
private SearchContext searchContext;
@GET
@Path("/actor/")
@Override
public List<Actor> getActorBy() {
SearchCondition<District> sc = searchContext.getCondition(Actor.class);
}
執行上searchContext方法getCondition當我收到NullPointerException異常。
其他休息電話正在工作。
有沒有辦法注入或配置SearchContext,所以我可以執行fiql搜索查詢?
重複? http://stackoverflow.com/questions/17045353/fiql-searchcontext-throws-nullpointerexception-when-injected-with-context – Vinze