Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在springboot的ClientHttpRequestInterceptor中使用自动连线注释_Spring_Spring Boot_Redis_Autowired_Spring Data Redis - Fatal编程技术网

如何在springboot的ClientHttpRequestInterceptor中使用自动连线注释

如何在springboot的ClientHttpRequestInterceptor中使用自动连线注释,spring,spring-boot,redis,autowired,spring-data-redis,Spring,Spring Boot,Redis,Autowired,Spring Data Redis,我想使用@Autowired在springboot public class RequestResponseHandlerInterceptor implements ClientHttpRequestInterceptor { @Autowired private localService localService; @Autowired private RedisTemplate<String, String> redisTemplate;

我想使用
@Autowired
springboot

public class RequestResponseHandlerInterceptor implements ClientHttpRequestInterceptor {

    @Autowired
    private localService localService;

    @Autowired
    private RedisTemplate<String, String> redisTemplate;

    private static final String AUTHORIZATION = "Authorization";


    @Override
    public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException {
        ClientHttpResponse response = null;
        ------
        ------
        return response;
    }

}
公共类RequestResponseHandlerInterceptor实现ClientHttpRequestInterceptor{
@自动连线
专用本地服务本地服务;
@自动连线
私有再贴现模板;
私有静态最终字符串AUTHORIZATION=“AUTHORIZATION”;
@凌驾
公共ClientHttpResponse截获(HttpRequest请求,字节[]正文,ClientHttpPrequesteExecution执行)引发IOException{
ClientHttpResponse响应=null;
------
------
返回响应;
}
}

您能详细说明一下您的情况吗。另请参阅我想通过redistemplate的access实例和我的本地服务进行一些预处理。你能在你想使用ClientHttPrequestinterCeptor的地方分享代码块吗?请详细说明你的案例。另请参阅我想通过redistemplate的access实例和我的本地服务进行一些预处理。您能在希望使用ClientHttpRequestInterceptor的地方共享代码块吗