返回信息流用Aspectj
@Aspect
@Component
public class LogInterceptor {
@Before("execution(public void com.ljy.dao.UserDAOImpl1.save(com.ljy.model.User))")
public void before(){
System.out.println("before");
}
}
ApplicationContext factory=new ClassPathXmlApplicationContext("beans.xml");
UserService userservice=(UserService)factory.getBean("userservice");
User user=new User();
userservice.add(user);
xml中的配置:
<aop:aspectj-autoproxy/>
但是那个@Before不起作用啊,到底是怎么回事
这是一条镜像帖。来源:北邮人论坛 / java / #39944同步于 2015/4/12
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Java机器人发帖
大神们,快来!Aspectj
laobaoer
2015/4/12镜像同步1 回复
订阅后,新回复会通过你的通知中心匿名送达。
1 条回复