我有 2 节课
@Component
@Scope(proxyMode=ScopedProxyMode.TARGET_CLASS,value="session")
public class Child extends Base{
}
@Component
@Scope(proxyMode=ScopedProxyMode.TARGET_CLASS,value="session")
public class Base{
private UserVO user;
public UserVO getUser(){
return user;
}
public void setUser(UserVO usr){
this.user = usr;
}
}
I call the following method
public class SomeClass{
@autowired
private Child child;
public void someMethod(){
child.setUser(new UserVO());
System.out.println(child.getUser());
}
}
上面的 system.out 打印 null。我哪里出错了。请帮忙。这是 cglib 的工作方式吗?如果是这样,解决方法是什么谢谢