【发布时间】:2017-01-16 09:08:09
【问题描述】:
我正在开发一个 web 服务,我需要验证在请求中针对数据库发送的特定 httpheader。
我想使用 RestEasy 提供程序来做同样的事情,因为需要将相同的功能应用于所有服务。
@Provider
@ServerInterceptor
public class TestValidationInterceptor implements PreProcessInterceptor {
@Autowired
DetailsDelegate detailsDelegate;
@Override
public ServerResponse preProcess(HttpRequest request, ResourceMethod method) throws Failure, WebApplicationException {
//code to get data using detailsDelegate.
return null;
}
}
public interface DetailsDelegate {
String BEAN_ID = "DetailsDelegate";
/**
* @param appName
* @return
* @throws BaseException
*/
ServiceInfo getServiceDetails(String appName) throws BaseException;
}
@Service("detailsDelegate")
public class DetailsDelegateImpl implements DetailsDelegate {
@Override
public ServiceInfo getServiceDetails(String appName) throws BaseException {
return null;
}
}
detailsDelegate 实例未自动装配并且为空。
谁能解释我为什么会遇到这个问题。
【问题讨论】:
-
你能分享你的配置和 DetailsDelegate 实现或类吗?
-
已在问题中更新。
标签: spring web-services resteasy jboss6.x