如下代码,出错了
public class MyController{
@Autowired
private RedisTemplate<String, String> redisTemplate;
SetOperations<String, String> setOperations;
HashOperations<String, String, String> hashOperations;
{
setOperations = redisTemplate.opsForSet();
hashOperations = redisTemplate.opsForHash();
}
是不是注解没有初始化块先执行? 这种状况如何改?