摘要: Controller返回值,String或者ModelAndView @RequestMapping关联url @RequestMapping的属性 一、 Controller返回值,String或者ModelAndView 首先看一下spring的配置文件,如下 <?xml version="1. 阅读全文
posted @ 2016-01-31 23:17 门罗的魔术师 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 本文讲述使用AspectJ框架实现Spring AOP。 再重复一下Spring AOP中的三个概念, Advice:向程序内部注入的代码。 Pointcut:注入Advice的位置,切入点,一般为某方法。 Advisor:Advice和Pointcut的结合单元,以便将Advice和Pointcu 阅读全文
posted @ 2016-01-31 23:14 门罗的魔术师 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 在《Spring3系列9- Spring AOP——Advice》和《Spring3系列10- Spring AOP——Pointcut,Advisor拦截指定方法》中的例子中,在配置文件中,你必须手动为每一个需要AOP的bean创建Proxy bean(ProxyFactoryBean)。 这不是 阅读全文
posted @ 2016-01-31 23:10 门罗的魔术师 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 上一篇的Spring AOP Advice例子中,Class(CustomerService)中的全部method都被自动的拦截了。但是大多情况下,你只需要一个方法去拦截一两 个method。这样就引入了Pointcut(切入点)的概念,它允许你根据method的名字去拦截指定的method。另外, 阅读全文
posted @ 2016-01-31 22:43 门罗的魔术师 阅读(167) 评论(0) 推荐(0) 编辑