
Spring编程笔记
文章平均质量分 77
杨过悔
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
4.spring的aop之@After
定义一个切面@Aspectpublic class AfterAdviceTest { // 匹配org.crazyit.app.service包下所有类的、 // 所有方法的执行作为切入点 @After("execution(* org.crazyit.app.service.*.*(..))") public void release() { System.out.print原创 2014-12-15 13:05:12 · 711 阅读 · 0 评论 -
2.spring的aop之@AfterThrowing
定义组件切点@Componentpublic class Chinese implements Person { // 实现Person接口的sayHello()方法 public String sayHello(String name) { System.out.println("sayHello方法被执行了"); // 返回简单的字符串 return name + " H原创 2014-12-15 12:47:37 · 735 阅读 · 0 评论 -
5.spring的aop之@Around
定义切点或组件@Componentpublic class Chinese implements Person { // 实现Person接口的sayHello()方法 public String sayHello(String name) { System.out.println("sayHello方法被调用..."); // 返回简单的字符串 return name +原创 2014-12-15 15:53:18 · 663 阅读 · 0 评论 -
6.spring自动装载
1.设值注入所需的setter方法 @Resource(name = "stoneAxe") public void setAxe(Axe axe) { this.axe = axe; }或者直接 @Autowired @Qualifier("steelAxe") private Axe axe;2.自动装载bean时可以过滤<beans xmlns="http:原创 2014-12-15 16:25:02 · 680 阅读 · 0 评论 -
1.spring的aop之@Before
首先创建一个组件或者切点@Componentpublic class Chinese implements Person { // 实现Person接口的sayHello()方法 public String sayHello(String name) { // 返回简单的字符串 return name + " Hello , Spring AOP"; } // 定义一个ea原创 2014-12-15 12:35:25 · 950 阅读 · 0 评论 -
3.spring的aop之@AfterReturning
定义需要切入的切入点@Componentpublic class Chinese implements Person { // 实现Person接口的sayHello()方法 public String sayHello(String name) { System.out.println("sayHello方法被执行了"); // 返回简单的字符串 return name +原创 2014-12-15 12:53:22 · 1878 阅读 · 0 评论 -
spring的DAO编程(jdbc)
1.spring管理jdbcapplicationContext.xml<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springfram原创 2015-03-06 08:45:50 · 498 阅读 · 0 评论 -
spring-data-jpa
1.config pom.xml<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.o转载 2015-05-21 13:36:14 · 494 阅读 · 0 评论 -
Spring中Bean的基本用法
1.引用Bean如: 2.需指定必定是同个XML下的Bean时,用3.属性值的注入 XXX txt //或者 使用P模型xmlns:p="http://www.springframework.org/schema/p"这样更加简便4原创 2015-08-20 22:45:06 · 749 阅读 · 0 评论