06 2022 档案
摘要: Spring是方法级别的AOP框架,我们主要也是以某个类的某个方法作为连接点,用动态代理的理论来说,就是要拦截哪个方法织入对应的AOP通知。为了更方便的测试我们首先创建一个接口 public interface RoleService { public void printRole(Role r
阅读全文
摘要:@Component 注解@component代表spring ioc 会把这个类扫描生成Bean实例 @Component public class Role{ @Value("1") private Long id; @Value("role_name_1") private String ro
阅读全文