码迷,mamicode.com
首页 > 编程语言 > 详细

Spring 进阶一

时间:2017-12-12 00:04:44      阅读:269      评论:0      收藏:0      [点我收藏+]

标签:lib   es2017   family   new   blog   分享   www.   三种方式   center   

Spring 进阶一

 

技术分享图片

 

 

以前创建对象都是通过new的方式

技术分享图片

Spring提出新的方案

 

Ioc底层的原理和使用技术

 

一:xml配置

 

二:Dom4j解析xml

 

三:工程的设计模式

 

四:反射

技术分享图片

Ioc入门案例

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-4.0.xsd





</beans>

 
   

 

通过配置文件创建对象

技术分享图片

class为创建对象类的全路径

技术分享图片

xml文件提示

技术分享图片

 

对象创建的三种方式

技术分享图片

第二种技术分享图片技术分享图片

第三种技术分享图片技术分享图片

 

 

Factory-method  为方法名

 

 

09-bean标签常用属性(idclassname

 

 

 技术分享图片

技术分享图片

 

 

11-属性注入介绍

技术分享图片

Spring框架只支持前面两种方式

构造方式 技术分享图片技术分享图片

打印结果

技术分享图片

Set注入

技术分享图片

技术分享图片

set注入对象

技术分享图片

15-注入复杂类型属性

P命名空间注入  还有很多比较复杂的注入   如  数组  list  map。。。

技术分享图片

 

IocdI的区别

技术分享图片

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Spring 进阶一

标签:lib   es2017   family   new   blog   分享   www.   三种方式   center   

原文地址:http://www.cnblogs.com/jiahaoJAVA/p/8025512.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!