﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-Kela's Blog-文章分类-我的笔记(Spring)</title><link>http://www.blogjava.net/kela/category/5298.html</link><description>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;前面的路很坎坷,但毕竟是条路.也许走过这一段就会发现,走过去就是梦想中的地方.因此坚持成为此刻唯一能做且必须去做的事情.
</description><language>zh-cn</language><lastBuildDate>Tue, 27 Feb 2007 13:59:10 GMT</lastBuildDate><pubDate>Tue, 27 Feb 2007 13:59:10 GMT</pubDate><ttl>60</ttl><item><title>kela的笔记 应用程序框架 ---- spring(10)</title><link>http://www.blogjava.net/kela/articles/80092.html</link><dc:creator>Kela</dc:creator><author>Kela</author><pubDate>Thu, 09 Nov 2006 03:54:00 GMT</pubDate><guid>http://www.blogjava.net/kela/articles/80092.html</guid><wfw:comment>http://www.blogjava.net/kela/comments/80092.html</wfw:comment><comments>http://www.blogjava.net/kela/articles/80092.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kela/comments/commentRss/80092.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kela/services/trackbacks/80092.html</trackback:ping><description><![CDATA[
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">摘要：使用<span lang="EN-US">JDBCTemplate<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span style="FONT-FAMILY: 宋体">对于一个基本的<span lang="EN-US">JDBC</span>存取，<span lang="EN-US">Connection</span>的取得，<span lang="EN-US">Statement</span>的建立，异常处理，<span lang="EN-US">Statement</span>的关闭，<span lang="EN-US">Connection</span>的关闭这些流程大致在不同的数据库技术上大致是相同的。<span lang="EN-US">Spring</span>提供的<span lang="EN-US">JdbcTemplate</span>类，被设计为线程安全，当中所提供的一些操作方法封装了类似上面的流程。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体">对于<span lang="EN-US">UserDAO.java</span>的<span lang="EN-US">JdbcTemplate</span>改进<span lang="EN-US"><o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">只需要改进相应的方法就可以了，其它的程序与文件不用变动。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">package com.kela.spring.jdbc;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">import java.util.Iterator;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">import java.util.List;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">import java.util.Map;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">import javax.sql.DataSource;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">import org.springframework.jdbc.core.JdbcTemplate;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">import com.kela.spring.util.Util;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public class Test implements IUserDAO {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>private JdbcTemplate jdbcTemplate;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void setDataSource(DataSource dataSource) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>jdbcTemplate = new JdbcTemplate(dataSource);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void insert(User user) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>String name = user.getName();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>int age = user.getAge().intValue();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>String sql = "INSERT INTO user (name, age) VALUES ('" + name + "', " + age + ")";<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>//</span>
				<span style="FONT-FAMILY: 宋体">转码<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>sql = Util.GBKToISO(sql);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>jdbcTemplate.update(sql);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public User find(Integer id) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>String sql = "SELECT * FROM user WHERE id = " + id.intValue();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>List rs = jdbcTemplate.queryForList(sql);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>Iterator it = rs.iterator();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>if(it.hasNext()) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>Map userMap = (Map)it.next();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>Integer i = new Integer(userMap.get("id").toString());<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>String name = Util.getStr(userMap.get("name").toString());//</span>
				<span style="FONT-FAMILY: 宋体">转码<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>Integer age<span style="mso-spacerun: yes">  </span>= new Integer(userMap.get("age").toString());<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>User user = new User();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>user.setId(i);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>user.setAge(age);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>user.setName(name);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>return user;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>return null;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体">几种<span lang="EN-US">JdbcTemplate</span>执行与更新，查询的演示<span lang="EN-US"><o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo2; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">A．<span style="FONT: 7pt 'Times New Roman'">  </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体">使用<span lang="EN-US">JdbcTemplate</span>的<span lang="EN-US">execute</span>（）方法执行<span lang="EN-US">SQL</span>陈述。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">jdbcTemploat.execute(sql);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo2; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">B．<span style="FONT: 7pt 'Times New Roman'">  </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体">如果是<span lang="EN-US">Update</span>或<span lang="EN-US">insert</span>，使用<span lang="EN-US">update</span>（）方法。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">… … …<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">使用预编译<span lang="EN-US">SQL</span>，<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public void insert(User user) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>final String name = user.getName();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>final int age = user.getAge().intValue();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>jdbcTemplate.update(new PreparedStatementCreator() {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>public PreparedStatement createPreparedStatement(Connection conn) throws SQLException {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 4">                </span>String sql = "INSERT INTO user (name, age) VALUES (?, ?)";<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 4">                </span>PreparedStatement ps = conn.prepareStatement(sql);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 4">                </span>ps.setString(1, name);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 4">                </span>ps.setInt(2, age);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 4">                </span>return ps;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">… … …<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public void insert(User user) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>final String name = user.getName();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>final int age = user.getAge().intValue();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>String sql = "INSERT INTO user (name, age) VALUES (?, ?)";<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>jdbcTemplate.update(sql, new PreparedStatementSetter() {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>public void setValues(PreparedStatement ps) throws SQLException {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 4">                </span>ps.setString(1, name);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 4">                </span>ps.setInt(2, age);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>});<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">… … …<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public void insert(User user) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>String sql = "INSERT INTO user (name, age) VALUES (?, ?)";<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>jdbcTemplate.update(sql, new Object[] {user.getName(), user.getAge()});<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">… … … <o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo2; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">C．<span style="FONT: 7pt 'Times New Roman'">  </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体">使用<span lang="EN-US">JdbcTemplate</span>进行查询时，可是使用<span lang="EN-US">queryForXXX</span>（）等方法。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">//</span>
				<span style="FONT-FAMILY: 宋体">返回一个整型<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">jdbcTemplate.queryForInt(“select count</span>
				<span style="FONT-FAMILY: 宋体">（<span lang="EN-US">*</span>）<span lang="EN-US"> from user</span>“<span lang="EN-US">)</span>；<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">//</span>
				<span style="FONT-FAMILY: 宋体">返回一个查询后的结果对象<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">jdbcTemplate.queryForObject(“select name from user where id = ?”, <o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 147pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">new Object[] {id}, <o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 147pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">java.lang.String.class);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">//</span>
				<span style="FONT-FAMILY: 宋体">返回多笔资料的列表<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">jdbcTemplate.queryForList</span>
				<span style="FONT-FAMILY: 宋体">（“<span lang="EN-US">select * from user”</span>）<span lang="EN-US">;<o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">List</span>
				<span style="FONT-FAMILY: 宋体">中包括的事<span lang="EN-US">Map</span>对象，每个<span lang="EN-US">Map</span>对象代表查询结果的一行记录。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
<img src ="http://www.blogjava.net/kela/aggbug/80092.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kela/" target="_blank">Kela</a> 2006-11-09 11:54 <a href="http://www.blogjava.net/kela/articles/80092.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>kela的笔记 应用程序框架 ---- spring(9)</title><link>http://www.blogjava.net/kela/articles/80052.html</link><dc:creator>Kela</dc:creator><author>Kela</author><pubDate>Thu, 09 Nov 2006 02:32:00 GMT</pubDate><guid>http://www.blogjava.net/kela/articles/80052.html</guid><wfw:comment>http://www.blogjava.net/kela/comments/80052.html</wfw:comment><comments>http://www.blogjava.net/kela/articles/80052.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kela/comments/commentRss/80052.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kela/services/trackbacks/80052.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 摘要：一个使用了DataSource注入的完整AOP例子。														 																		●     														IUserDAO.java																		 												完成一个插入和查询方法								package...&nbsp;&nbsp;<a href='http://www.blogjava.net/kela/articles/80052.html'>阅读全文</a><img src ="http://www.blogjava.net/kela/aggbug/80052.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kela/" target="_blank">Kela</a> 2006-11-09 10:32 <a href="http://www.blogjava.net/kela/articles/80052.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>kela的笔记 应用程序框架 ---- spring(8)</title><link>http://www.blogjava.net/kela/articles/80022.html</link><dc:creator>Kela</dc:creator><author>Kela</author><pubDate>Thu, 09 Nov 2006 01:30:00 GMT</pubDate><guid>http://www.blogjava.net/kela/articles/80022.html</guid><wfw:comment>http://www.blogjava.net/kela/comments/80022.html</wfw:comment><comments>http://www.blogjava.net/kela/articles/80022.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kela/comments/commentRss/80022.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kela/services/trackbacks/80022.html</trackback:ping><description><![CDATA[
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">摘要：<span lang="EN-US">Spring</span>的<span lang="EN-US">JDBC</span>支持，<span lang="EN-US">Spring</span>提供了<span lang="EN-US">DAO</span>框架，提供了对数据库存取时异常的封装，提供的<span lang="EN-US">JdbcTemplate</span>类大大简化了<span lang="EN-US">JDBC</span>在<span lang="EN-US">API</span>上的操作等。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span style="FONT-FAMILY: 宋体">一个传统<span lang="EN-US">DAO</span>的例子。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span style="FONT-FAMILY: 宋体">如，现在有一个数据库表<span lang="EN-US">user</span>，该表有<span lang="EN-US">id</span>，<span lang="EN-US">name</span>，<span lang="EN-US">age</span>三个字段。对该表抽象得出<span lang="EN-US">User</span>对象，在进行数据库操作时（<span lang="EN-US">find</span>，<span lang="EN-US">insert</span>，<span lang="EN-US">update</span>，<span lang="EN-US">delete</span>）应用程序不应依赖于一个实际的类实现，而是可以让它依赖一个接口，在应用程序中通过对接口的声明来操作。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">User.java<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">这是<span lang="EN-US">User</span>对象<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">package com.kela.spring.jdbc;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public class User {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>private Integer id;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>private String name;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>private Integer age;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public Integer getAge() {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>return age;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void setAge(Integer age) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>this.age = age;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public Integer getId() {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>return id;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void setId(Integer id) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>this.id = id;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public String getName() {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>return name;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void setName(String name) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>this.name = name;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">IUserDAO.java<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">这是<span lang="EN-US">IUserDAO</span>接口，负责声明对<span lang="EN-US">User</span>对象的操作。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">package com.kela.spring.jdbc;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public interface IUserDAO {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void insert(User user);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public User find(Integer id);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public void update(User user);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public void delete(User user);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">UserDAO.java<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">具体的数据库存取类，实现了<span lang="EN-US">IUserDAO</span>接口。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">package com.kela.spring.jdbc;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public class UserDAO implements IUserDAO {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public void insert(User user) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-spacerun: yes">    </span>Connnection conn = null;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-spacerun: yes">    </span>Statement stmt = null;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-spacerun: yes">    </span>try {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>//</span>
				<span style="FONT-FAMILY: 宋体">执行数据库插入操作<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-spacerun: yes">    </span>} catch (SQLException e) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-spacerun: yes">    </span>
						<span style="mso-tab-count: 1">    </span>//…<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-spacerun: yes">    </span>} finally{<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>//…<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 42pt; mso-char-indent-count: 4.0">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public User find(Integer id) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>//</span>
				<span style="FONT-FAMILY: 宋体">查询<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>return user;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public void update(User user) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>//…<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public void delete(User user) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>//…<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">Test.java<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">在应用程序中进行数据存取时，可以使用<span lang="EN-US">IUserDAO</span>来声明接口，进行数据操作。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">… …<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">User user = new User();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">user.setId(new Integer(2));<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">user.setName(“kela”);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">user.setAge(new Integer(28));<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">IUserDAO userDao = new UserDAO();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">userDao.insert(user);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">… …<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体">学习小结<span lang="EN-US"><o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span style="FONT-FAMILY: 宋体">由于依赖于接口，所以可以随时替换<span lang="EN-US">IUserDAO</span>的实现类，在<span lang="EN-US">IUserDAO</span>接口声明的操作方法上并没有任何于底层数据库存取的技术细节，<span lang="EN-US">Spring</span>的<span lang="EN-US">DAO</span>框架这是基于这样的原理，将应用程序与底层存取技术隔离开来。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p>
				<a href="">
				</a> </p>
<img src ="http://www.blogjava.net/kela/aggbug/80022.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kela/" target="_blank">Kela</a> 2006-11-09 09:30 <a href="http://www.blogjava.net/kela/articles/80022.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>kela的笔记 应用程序框架 ---- spring(7)</title><link>http://www.blogjava.net/kela/articles/66464.html</link><dc:creator>Kela</dc:creator><author>Kela</author><pubDate>Tue, 29 Aug 2006 08:35:00 GMT</pubDate><guid>http://www.blogjava.net/kela/articles/66464.html</guid><wfw:comment>http://www.blogjava.net/kela/comments/66464.html</wfw:comment><comments>http://www.blogjava.net/kela/articles/66464.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kela/comments/commentRss/66464.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kela/services/trackbacks/66464.html</trackback:ping><description><![CDATA[
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">摘要：<span lang="EN-US">Spring AOP </span>，从代理机制看<span lang="EN-US">AOP</span>，动态代理的范例<span lang="EN-US"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">在<span lang="EN-US">JDK1.3</span>之后加入了可协助开发动态代理功能的<span lang="EN-US">API</span>，你不必为特定对象与方法编写特定的代理对象，使用动态代理，可以使用一个处理者（<span lang="EN-US">Handler</span>）服务于各个对象。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">LogHandler.java<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">package com.kela.spring.aop;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">import java.lang.reflect.InvocationHandler;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">import java.lang.reflect.Method;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">import java.lang.reflect.Proxy;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">import org.apache.log4j.Logger;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public class LogHandler implements InvocationHandler {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>private Logger log = Logger.getLogger(this.getClass().getName());<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>private Object delegate;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public Object bind(Object delegate) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>this.delegate = delegate;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>return Proxy.newProxyInstance(delegate.getClass().getClassLoader(), delegate.getClass().getInterfaces(), this);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public Object invoke(Object arg0, Method method, Object[] args)<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>throws Throwable {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>Object result = null;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>try {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>log.info("hello </span>
				<span style="FONT-FAMILY: 宋体">方法开始执行<span lang="EN-US">... ...");<o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>result = method.invoke(delegate, args);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>log.info("hello </span>
				<span style="FONT-FAMILY: 宋体">方法执行完毕<span lang="EN-US">");<o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>} catch (Exception e) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>System.out.println("[ERROR]" + e.getMessage());<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>return result;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">IHell.java<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">package com.kela.spring.aop;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public interface IHello {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void hello(String name);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">HelloSpeaker.java<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">package com.kela.spring.aop;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public class HelloSpeaker implements IHello {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void hello(String name) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>System.out.println("</span>
				<span style="FONT-FAMILY: 宋体">你好，<span lang="EN-US">" + name);<o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">ProxyDemo.java<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">package com.kela.spring.aop;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public class ProxyDemo {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void method_2() {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>LogHandler logHandler = new LogHandler();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>IHello helloProxy = (IHello)logHandler.bind(new HelloSpeaker());<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>helloProxy.hello("kela");<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public static void main(String[] args) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>ProxyDemo proxyDemo = new ProxyDemo();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>proxyDemo.method_2();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体">学习小结<span lang="EN-US"><o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">使用代理对象将记录等于业务逻辑无关的动作或任务提取出来，设计为一个服务对象，如<span lang="EN-US">LogHandler</span>和上一小节中的<span lang="EN-US">HelloProxy</span>，这样的对象称之为切面（<span lang="EN-US">Aspect</span>）。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
<img src ="http://www.blogjava.net/kela/aggbug/66464.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kela/" target="_blank">Kela</a> 2006-08-29 16:35 <a href="http://www.blogjava.net/kela/articles/66464.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>kela的笔记 应用程序框架 ---- spring(6)</title><link>http://www.blogjava.net/kela/articles/66449.html</link><dc:creator>Kela</dc:creator><author>Kela</author><pubDate>Tue, 29 Aug 2006 07:27:00 GMT</pubDate><guid>http://www.blogjava.net/kela/articles/66449.html</guid><wfw:comment>http://www.blogjava.net/kela/comments/66449.html</wfw:comment><comments>http://www.blogjava.net/kela/articles/66449.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kela/comments/commentRss/66449.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kela/services/trackbacks/66449.html</trackback:ping><description><![CDATA[
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">摘要：<span lang="EN-US">Spring AOP </span>，从代理机制看<span lang="EN-US">AOP</span>，静态代理的范例。<span lang="EN-US"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">在一个服务的流程中插入与业务逻辑无关的系统服务逻辑（比如<span lang="EN-US"> Logging</span>、<span lang="EN-US">Security</span>），这样的逻辑称为<span lang="EN-US">Cross-cutting concerns</span>，将<span lang="EN-US">Cross-cutting concerns</span>独立出来设计为一个对象，这样的特殊对象称之为<span lang="EN-US">Aspect</span>，<span lang="EN-US">Aspect-oriented programming</span>着重在<span lang="EN-US">Aspect</span>的设计及与应用程序的织入（<span lang="EN-US">Weave</span>）。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体">静态代理<span lang="EN-US"><o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">在静态代理的实现中，代理对象与被代理对象都必须实现同一个接口，在代理对象中可以实现日志记录等相关服务，并在需要的时候再呼叫被代理的对象，如此代理对象当中就可以仅保留业务相关职责。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">IHello.java<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">package com.kela.spring.aop;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public interface IHello {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void hello(String name);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">HelloSpeaker.java<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">package com.kela.spring.aop;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public class HelloSpeaker implements IHello {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void hello(String name) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>System.out.println("</span>
				<span style="FONT-FAMILY: 宋体">你好，<span lang="EN-US">" + name);<o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">HelloProxy.java<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">package com.kela.spring.aop;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">import org.apache.log4j.Logger;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public class HelloProxy implements IHello {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>private Logger log = Logger.getLogger(this.getClass().getName());<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>private IHello helloObject;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public HelloProxy(IHello helloObject) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>this.helloObject = helloObject;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void hello(String name) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>//</span>
				<span style="FONT-FAMILY: 宋体">日志记录<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>log.info("hello </span>
				<span style="FONT-FAMILY: 宋体">方法开始执行<span lang="EN-US">... ...");<o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>//</span>
				<span style="FONT-FAMILY: 宋体">执行业务逻辑<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>helloObject.hello(name);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>//</span>
				<span style="FONT-FAMILY: 宋体">日志记录<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>log.info("hello </span>
				<span style="FONT-FAMILY: 宋体">方法执行完毕<span lang="EN-US">");<o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">ProxyDemo.java<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">package com.kela.spring.aop;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public class ProxyDemo {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public static void main(String[] args) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>HelloProxy proxy = new HelloProxy(new HelloSpeaker());<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>proxy.hello("KELA");<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体">运行结果<span lang="EN-US"><o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">HelloProxy - hello </span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-highlight: white; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">方法开始执行</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">... ...</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
								<span style="mso-spacerun: yes"> </span>
						</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-highlight: white; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">你好，</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">KELA</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">HelloProxy - hello </span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-highlight: white; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">方法执行完毕</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体">学习小结<span lang="EN-US"><o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">静态代理中，代理对象的一个接口只服务于一种类型的对象，而且如果要代理的方法很多，势必要为每个方法进行代理，静态代理在程序规模稍大时就无法胜任。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
<img src ="http://www.blogjava.net/kela/aggbug/66449.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kela/" target="_blank">Kela</a> 2006-08-29 15:27 <a href="http://www.blogjava.net/kela/articles/66449.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>kela的笔记 应用程序框架 ---- spring(5)</title><link>http://www.blogjava.net/kela/articles/65323.html</link><dc:creator>Kela</dc:creator><author>Kela</author><pubDate>Wed, 23 Aug 2006 09:36:00 GMT</pubDate><guid>http://www.blogjava.net/kela/articles/65323.html</guid><wfw:comment>http://www.blogjava.net/kela/comments/65323.html</wfw:comment><comments>http://www.blogjava.net/kela/articles/65323.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kela/comments/commentRss/65323.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kela/services/trackbacks/65323.html</trackback:ping><description><![CDATA[
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">摘要：<span lang="EN-US">Bean</span>的生命周期。一个<span lang="EN-US">Bean</span>从建立到销毁，如果是使用<span lang="EN-US">BeanFactory</span>来生成，管理<span lang="EN-US">Bean</span>的话，会经历几个执行阶段。<span lang="EN-US"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">Bean</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体">的建立<span lang="EN-US"><o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">由<span lang="EN-US">BeanFactory</span>读取<span lang="EN-US">Bean</span>定义文件，并生成各个<span lang="EN-US">Bean</span>实例。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">在<span lang="EN-US">Spring</span>中，默认取得的实例为<span lang="EN-US">Singleton</span>模式，即每一次<span lang="EN-US">context.getBean(“beanName”)</span>取得的对象都是同一个，而不是每次都产生一个新的对象。大部分情况下<span lang="EN-US">Singleton</span>是能够满足要求的，如果考虑到线程安全等的问题，需使用<span lang="EN-US">Prototype</span>模式，即每次取得的对象都是一个独立的对象，只需要将<span lang="EN-US">singleton=”false”</span>即可。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">如：<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;bean</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">id=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"someBean"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">class=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"com.kela.spring.ioc.SomeBean"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">singleton=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"false"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体">属性注入<span lang="EN-US"><o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">执行相关的<span lang="EN-US">Bean</span>属性依赖注入<b style="mso-bidi-font-weight: normal"><span lang="EN-US"><o:p></o:p></span></b></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">BeanNameAware</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体">的<span lang="EN-US">setBeanName</span>（）<span lang="EN-US"><o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">如果<span lang="EN-US">Bean</span>类有实现<span lang="EN-US">org.springframework.beans.factory.BeanNameAware</span>接口，则执行它的<span lang="EN-US">setBaenName</span>（）方法。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">实现<span lang="EN-US">BeanNameAware</span>接口的<span lang="EN-US">Bean</span>类，在依赖关系设定完成后，初始化方法之前，将<span lang="EN-US">Bean</span>的定义文件中的名称设定给<span lang="EN-US">Bean</span>。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">注：<span lang="EN-US">Spring</span>中提供了一些<span lang="EN-US">Aware</span>相关接口，实现这些<span lang="EN-US">Aware</span>接口的<span lang="EN-US">Bean</span>类在被初始化之后，可以取得一些<span lang="EN-US">Spring</span>所提供的资源或使用某些功能。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">一旦实现了提供的相关接口，则应用程序就会使用到<span lang="EN-US">Spring</span>的相关<span lang="EN-US">API</span>，而与<span lang="EN-US">Spring</span>产生耦合关系。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">BeanFactoryAware</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体">的<span lang="EN-US">setBeanFactory</span>（）<span lang="EN-US"><o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">如果<span lang="EN-US">bean</span>类有实现<span lang="EN-US">org.springframework.beans.factory.BeanFactoryAware</span>接口，则执行它的<span lang="EN-US">setBeanFactory</span>。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">实现<span lang="EN-US">BeanFactoryAware</span>接口的<span lang="EN-US">Bean</span>类，在依赖关系设定完成后，初始化方法之前，<span lang="EN-US">Spring</span>容器将会注入<span lang="EN-US">BeanFactory</span>的实例。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">BeanPostProcessor</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体">的<span lang="EN-US">postProcessBeforeInitialization</span>（）<span lang="EN-US"><o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">如果任何的<span lang="EN-US">org.springfaramwork.beans.factory.config.BeanPostProcessor</span>实例与<span lang="EN-US">Bean</span>实例关联，则执行<span lang="EN-US">BeanPostProcessors</span>实例的<span lang="EN-US">postProcessBeforeInitialization</span>（）方法。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">InitializingBean</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体">的<span lang="EN-US">afterPropertiesSet</span>（）<span lang="EN-US"><o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">如果<span lang="EN-US">Bean</span>类以实现<span lang="EN-US">org.springfaramwork.beans.factory.InitializingBean</span>接口，则执行它的<span lang="EN-US">afterPropertiesSet</span>（）方法。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">Bean</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体">定义文件中定义<span lang="EN-US">init-method<o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">可以在<span lang="EN-US">Bean</span>定义文件使用“<span lang="EN-US">init-method</span>”属性设定方法名称，例如：<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;bean</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">id=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"someBean"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">class=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"com.kela.spring.ioc.SomeBean"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">init-method=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"initBean"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">如果有以上设定的话，则进行至这个阶段时，就会执行<span lang="EN-US">initBean</span>（）方法。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">BeanPostProcessor</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体">的<span lang="EN-US">postProcessAfterInitialization</span>（）<span lang="EN-US"><o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">如果任何的<span lang="EN-US">org.springfaramwork.beans.factory.config.BeanPostProcessor</span>实例与<span lang="EN-US">Bean</span>实例关联，则执行<span lang="EN-US">BeanPostProcessors</span>实例的<span lang="EN-US">postProcessAfterInitialization</span>（）方法。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">DisposableBean</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体">的<span lang="EN-US">destroy</span>（）<span lang="EN-US"><o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">在容器关闭时，如果<span lang="EN-US">Bean</span>类有实现<span lang="EN-US">org.springframework.beans.factory.DisposableBean</span>接口，则执行它的<span lang="EN-US">destroy</span>（）方法。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">Bean</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体">定义文件中定义<span lang="EN-US">destroy-method<o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">在容器关闭时，可以在<span lang="EN-US">Bean</span>定义文件中使用“<span lang="EN-US">destroy-method</span>”属性设定方法名称，例如：<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">…<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;bean</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">id=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"someBean"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">class=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"com.kela.spring.ioc.SomeBean"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">destroy-method=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"destroyBean"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">如果有以上设定的话，则进行至这个阶段时，就会执行<span lang="EN-US">destroyBean</span>（）方法。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">注意：如果是使用<span lang="EN-US">ApplicationContext</span>来生成并管理<span lang="EN-US">Bean</span>的话则稍有不同，使用<span lang="EN-US">ApplicationContext</span>来生成及管理<span lang="EN-US">Bean</span>实例的话，在执行<span lang="EN-US">BeanFactoryAware</span>的<span lang="EN-US">setBeanFactory</span>（）阶段之后，若<span lang="EN-US">Bean</span>类上有实现<span lang="EN-US">org.springframework.context.ApplicationContextAware</span>接口，则执行其<span lang="EN-US">setApplicationContext</span>（）方法，接着才继续进行<span lang="EN-US">BeanPostProcessor</span>的<span lang="EN-US">postProcessBeforeInitialization</span>（）及之后的流程。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
<img src ="http://www.blogjava.net/kela/aggbug/65323.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kela/" target="_blank">Kela</a> 2006-08-23 17:36 <a href="http://www.blogjava.net/kela/articles/65323.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>kela的笔记 应用程序框架 ---- spring(4)</title><link>http://www.blogjava.net/kela/articles/65042.html</link><dc:creator>Kela</dc:creator><author>Kela</author><pubDate>Tue, 22 Aug 2006 04:28:00 GMT</pubDate><guid>http://www.blogjava.net/kela/articles/65042.html</guid><wfw:comment>http://www.blogjava.net/kela/comments/65042.html</wfw:comment><comments>http://www.blogjava.net/kela/articles/65042.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kela/comments/commentRss/65042.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kela/services/trackbacks/65042.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 摘要：关于集合对象的注入（Array，List，Map）														 																		●     								SomeBean.java														 												import java.util.List;								import java...&nbsp;&nbsp;<a href='http://www.blogjava.net/kela/articles/65042.html'>阅读全文</a><img src ="http://www.blogjava.net/kela/aggbug/65042.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kela/" target="_blank">Kela</a> 2006-08-22 12:28 <a href="http://www.blogjava.net/kela/articles/65042.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>kela的笔记 应用程序框架 ---- spring(3)</title><link>http://www.blogjava.net/kela/articles/64992.html</link><dc:creator>Kela</dc:creator><author>Kela</author><pubDate>Tue, 22 Aug 2006 02:41:00 GMT</pubDate><guid>http://www.blogjava.net/kela/articles/64992.html</guid><wfw:comment>http://www.blogjava.net/kela/comments/64992.html</wfw:comment><comments>http://www.blogjava.net/kela/articles/64992.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kela/comments/commentRss/64992.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kela/services/trackbacks/64992.html</trackback:ping><description><![CDATA[
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">摘要：属性参考至对象。一个对象的属性参考另一个对象的实例，如，学生（<span lang="EN-US">StudentBean</span>）对象有两个属性一个是<span lang="EN-US">name</span>一个是<span lang="EN-US">addressBean</span>，<span lang="EN-US">name</span>是一个<span lang="EN-US">String</span>型，而<span lang="EN-US">addressBean</span>是<span lang="EN-US">AddressBean</span>对象（地址对象）的一个实例。<span lang="EN-US"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">StrudentBean.java<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">package com.kela.spring.ioc;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public class StudentBean {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>private String name;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>private AddressBean addressBean;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public AddressBean getAddressBean() {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>return addressBean;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void setAddressBean(AddressBean addressBean) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>this.addressBean = addressBean;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public String getName() {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>return name;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void setName(String name) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>this.name = name;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">AddressBean.java<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">package com.kela.spring.ioc;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public class AddressBean {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>private String addressName;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public String getAddressName() {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>return addressName;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void setAddressName(String addressName) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>this.addressName = addressName;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">beans-config_2.xml<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;?xml</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">version=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"1.0"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">encoding=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"GB2312"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">?&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;!DOCTYPE</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">beans</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">PUBLIC</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"-//SPRING//DTD BEAN//EN"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"http://www.springframework.org/dtd/spring-beans.dtd"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;beans&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 1">    </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;bean</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">id=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"addressBean"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">class=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"com.kela.spring.ioc.AddressBean"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 2">       </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;property</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">name=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"addressName"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 3">           </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;value&gt;</span>
				<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">团结大街向阳路</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">123</span>
				<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">号</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/value&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 2">       </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/property&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 1">    </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/bean&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 1">    </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 1">    </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;bean</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">id=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"studentBean"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">class=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"com.kela.spring.ioc.StudentBean"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 2">       </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;property</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">name=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"name"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 3">           </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;value&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">KangFeng</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/value&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 2">       </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/property&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 2">       </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;property</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">name=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"addressBean"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 3">           </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;!--</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">注意这里已不是</span>
				<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">value</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">了，改为</span>
				<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">ref</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">--&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 3">           </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;ref</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">bean=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"addressBean"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;&lt;/ref&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 2">       </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/property&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 1">    </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/bean&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/beans&gt;</span>
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">TestClass.java<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">import org.springframework.context.ApplicationContext;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">import org.springframework.context.support.FileSystemXmlApplicationContext;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public class TestClass {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void method_2() {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>try {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>ApplicationContext context = new FileSystemXmlApplicationContext("bin\\com\\kela\\spring\\ioc\\beans-config_2.xml");<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>StudentBean studentBean = (StudentBean)context.getBean("studentBean");<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>System.out.println("</span>
				<span style="FONT-FAMILY: 宋体">姓名：<span lang="EN-US">" + studentBean.getName() + ";</span>地址：<span lang="EN-US">" + studentBean.getAddressBean().getAddressName());<o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>} catch (Exception e) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>System.out.println("[ERROR]" + e.getMessage());<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public static void main(String[] args) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>TestClass testClass = new TestClass();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>testClass.method_2();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体">学习小结<span lang="EN-US"><o:p></o:p></span></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">“<span lang="EN-US">Don’t Call Me</span>，<span lang="EN-US">I</span>‘<span lang="EN-US">ll Call You</span>”。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
<img src ="http://www.blogjava.net/kela/aggbug/64992.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kela/" target="_blank">Kela</a> 2006-08-22 10:41 <a href="http://www.blogjava.net/kela/articles/64992.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>kela的笔记 应用程序框架 ---- spring(2)</title><link>http://www.blogjava.net/kela/articles/64961.html</link><dc:creator>Kela</dc:creator><author>Kela</author><pubDate>Tue, 22 Aug 2006 01:36:00 GMT</pubDate><guid>http://www.blogjava.net/kela/articles/64961.html</guid><wfw:comment>http://www.blogjava.net/kela/comments/64961.html</wfw:comment><comments>http://www.blogjava.net/kela/articles/64961.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kela/comments/commentRss/64961.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kela/services/trackbacks/64961.html</trackback:ping><description><![CDATA[
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">摘要：</span>
				<span lang="EN-US">spring</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">两种常用的注入方式（</span>
				<span lang="EN-US">Type 2 Ioc</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</span>
				<span lang="EN-US">Type 3 Ioc</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?>
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">HelloBean.java<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">package com.kela.spring.ioc;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public class HelloBean {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>private String name;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>private String helloWord;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public HelloBean() {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public HelloBean(String name, String helloWord) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>this.name = name;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>this.helloWord = helloWord;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public String getHelloWord() {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>return helloWord;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void setHelloWord(String helloWord) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>this.helloWord = helloWord;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public String getName() {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>return name;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void setName(String name) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>this.name = name;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体">该程序文件中讲两种常用的注入方式写在了一起。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">Beans-config_1.xml<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;?xml</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">version=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"1.0"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">encoding=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"GB2312"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">?&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;!DOCTYPE</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">beans</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">PUBLIC</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"-//SPRING//DTD BEAN//EN"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"http://www.springframework.org/dtd/spring-beans.dtd"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;beans&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 1">    </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 1">    </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;!--</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">Type</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">3</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">Injection</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">通过构造方法（这里注意构造方法中参数的顺序保持一致）</span>
				<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">--&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 1">    </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;bean</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">id=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"helloBean_1"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">class=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"com.kela.spring.ioc.HelloBean"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 2">       </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;constructor-arg</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">index=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"0"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 3">           </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;value&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">KangFeng</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/value&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 2">       </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/constructor-arg&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 2">       </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;constructor-arg</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">index=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"1"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 3">           </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;value&gt;</span>
				<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">你好！</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/value&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 2">       </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/constructor-arg&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 1">    </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/bean&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 1">    </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 1">    </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;!--</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">Type2</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">Injection</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">通过</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">set</span>
				<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">注入法</span>
				<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #228820; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">--&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 1">    </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;bean</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">id=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"helloBean_2"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">class=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"com.kela.spring.ioc.HelloBean"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 2">       </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;property</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">name=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"name"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 3">           </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;value&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">Kela</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/value&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 2">       </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/property&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 2">       </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;property</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">name=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"helloWord"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 3">           </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;value&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">hello</span>
				<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">！</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/value&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 2">       </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/property&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 1">    </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/bean&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/beans&gt;</span>
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-FAMILY: 宋体">TestClass.java<o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">package com.kela.spring.ioc;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">import org.springframework.context.ApplicationContext;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">import org.springframework.context.support.FileSystemXmlApplicationContext;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">public class TestClass {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public void method_1() {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>try {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>ApplicationContext context = new <o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">                                       FileSystemXmlApplicationContext("bin\\com\\kela\\spring\\ioc\\beans-config_1.xml");<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>HelloBean helloBean_1 = (HelloBean)context.getBean("helloBean_1");<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>System.out.println("</span>
				<span style="FONT-FAMILY: 宋体">构造方法注入（欢迎词）：<span lang="EN-US">" + helloBean_1.getName() + ";" + helloBean_1.getHelloWord());<o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>HelloBean helloBean_2 = (HelloBean)context.getBean("helloBean_2");<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>System.out.println("set</span>
				<span style="FONT-FAMILY: 宋体">方法注入（欢迎词）：<span lang="EN-US">" + helloBean_2.getName() + ";" + helloBean_2.getHelloWord());<o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>} catch (Exception e) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 3">            </span>System.out.println("[ERROR]" + e.getMessage());<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>public static void main(String[] args) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>TestClass testClass = new TestClass();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 2">        </span>testClass.method_1();<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<b style="mso-bidi-font-weight: normal">学习小结</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span style="FONT-FAMILY: 宋体">关于<span lang="EN-US">Constructor</span>和<span lang="EN-US">Setter</span>注入的区别其实就是说，是要在对象建时是就准备好资源还是在对象建立好之后，再使用<span lang="EN-US">Setter</span>方法来进行设定。<span lang="EN-US"><o:p></o:p></span></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span style="FONT-FAMILY: 宋体">从实际使用角度来看，一个适用于较短的属性列，一个适用于较长的属性列。<b style="mso-bidi-font-weight: normal"><span lang="EN-US"><o:p></o:p></span></b></span>
		</p>
<img src ="http://www.blogjava.net/kela/aggbug/64961.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kela/" target="_blank">Kela</a> 2006-08-22 09:36 <a href="http://www.blogjava.net/kela/articles/64961.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>kela的笔记 应用程序框架 ---- spring(1)</title><link>http://www.blogjava.net/kela/articles/64725.html</link><dc:creator>Kela</dc:creator><author>Kela</author><pubDate>Mon, 21 Aug 2006 02:23:00 GMT</pubDate><guid>http://www.blogjava.net/kela/articles/64725.html</guid><wfw:comment>http://www.blogjava.net/kela/comments/64725.html</wfw:comment><comments>http://www.blogjava.net/kela/articles/64725.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kela/comments/commentRss/64725.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kela/services/trackbacks/64725.html</trackback:ping><description><![CDATA[
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">注：仅仅是个人学习总结的笔记，例子来自于《</span>
				<span lang="EN-US">Spring</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">技术手册》、《</span>
				<span lang="EN-US">Expert One-On-One J2EE Development Without EJB</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中文版》、以及一些网络文档等。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?>
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="mso-fareast-font-family: 'Times New Roman'">
								<span style="mso-list: Ignore">1.<span style="FONT: 7pt 'Times New Roman'">       </span></span>
						</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">准备工作</span>
						<span lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">从下载的</span>
				<span lang="EN-US">spring</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">开发包</span>
				<span lang="EN-US">bin</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">目录下将相关</span>
				<span lang="EN-US">lib</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">加入至项目的</span>
				<span lang="EN-US">ClassPath</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我加入的</span>
				<span lang="EN-US">lib</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件有：</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">spring.jar</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（这个文件包括了所有</span>
				<span lang="EN-US">Spring</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">支持的功能所需要的类，而不再需要加入个别的</span>
				<span lang="EN-US">jar</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件，关于</span>
				<span lang="EN-US">Spring</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">各个具体的</span>
				<span lang="EN-US">jar</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">包的使用范围，可查询</span>
				<span lang="EN-US">Spring</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的中文文档）</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">commons-logging.jar</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">；</span>
				<span lang="EN-US">log4j.jar</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</span>
				<span lang="EN-US">log</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">日志所需）</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">编写</span>
				<span lang="EN-US">log4j</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">配置文件</span>
				<span lang="EN-US">log4j.properties</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，将其放入</span>
				<span lang="EN-US">src</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">下，</span>
				<span lang="EN-US">log4j.properties</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">内容如下：</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 20pt; TEXT-ALIGN: left; mso-layout-grid-align: none; mso-char-indent-count: 2.0" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">log4j.rootLogger=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">ERROR,</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">stdout</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 20pt; TEXT-ALIGN: left; mso-layout-grid-align: none; mso-char-indent-count: 2.0" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 20pt; TEXT-ALIGN: left; mso-layout-grid-align: none; mso-char-indent-count: 2.0" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">log4j.appender.stdout=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">org.apache.log4j.ConsoleAppender</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 20pt; TEXT-ALIGN: left; mso-layout-grid-align: none; mso-char-indent-count: 2.0" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">log4j.appender.stdout.layout=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">org.apache.log4j.PatternLayout</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 20pt; TEXT-ALIGN: left; mso-layout-grid-align: none; mso-char-indent-count: 2.0" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">log4j.appender.stdout.layout.ConversionPattern=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">%c</span>
				<b>
						<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #7f0055; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">{1}</span>
				</b>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">-</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">%m%n</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 20pt; TEXT-ALIGN: left; mso-layout-grid-align: none; mso-char-indent-count: 2.0" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; TEXT-ALIGN: left; mso-layout-grid-align: none; mso-char-indent-count: 2.0" align="left">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我的工程目录结构如下：<br /><br />    SpringProject（工程名称）<br />       src<br />          log4j.properties<br />       lib<br />          commons-logging.jar<br />          log4j-1.2.9.jar<br />          spring.jar<br /></span>
				<span lang="EN-US">
						<o:p>          </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="mso-fareast-font-family: 'Times New Roman'">
								<span style="mso-list: Ignore">2.<span style="FONT: 7pt 'Times New Roman'">       </span></span>
						</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">编写第一个</span>
						<span lang="EN-US">Spring</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序</span>
						<span lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这是一个简单的</span>
				<span lang="EN-US">JavaBean</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，用来打声招呼。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US" style="FONT-FAMILY: 宋体">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 39pt; TEXT-INDENT: -18pt; mso-list: l0 level2 lfo1; tab-stops: list 39.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<span lang="EN-US">HelloBean.java</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">package com.kela.spring.helloword;</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">public class HelloBean {</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">
						<span style="mso-tab-count: 1">       </span>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">
						<span style="mso-tab-count: 1">       </span>private String helloWord;</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">
						<span style="mso-tab-count: 1">       </span>public String getHelloWord() {</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">
						<span style="mso-tab-count: 2">              </span>return helloWord;</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">
						<span style="mso-tab-count: 1">       </span>}</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">
						<span style="mso-tab-count: 1">       </span>public void setHelloWord(String helloWord) {</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">
						<span style="mso-tab-count: 2">              </span>this.helloWord = helloWord;</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">
						<span style="mso-tab-count: 1">       </span>}</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">}</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 39pt; TEXT-INDENT: -18pt; mso-list: l0 level2 lfo1; tab-stops: list 39.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<span lang="EN-US">beans-config.xml</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 20pt; TEXT-ALIGN: left; mso-layout-grid-align: none; mso-char-indent-count: 2.0" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;?xml</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">version=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"1.0"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">encoding=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"GB2312"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">?&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 40.05pt; TEXT-INDENT: -20pt; TEXT-ALIGN: left; mso-layout-grid-align: none; mso-char-indent-count: -2.0; mso-para-margin-left: 1.91gd" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;!DOCTYPE</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">beans</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">PUBLIC</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"-//SPRING//DTD BEAN//EN"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"http://www.springframework.org/dtd/spring-beans.dtd"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<span style="mso-spacerun: yes">    </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 20pt; TEXT-ALIGN: left; mso-layout-grid-align: none; mso-char-indent-count: 2.0" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;beans&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 10.05pt; TEXT-INDENT: -5pt; TEXT-ALIGN: left; mso-layout-grid-align: none; mso-char-indent-count: -.5; mso-para-margin-left: .48gd" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 1">
						</span>
						<span style="mso-spacerun: yes">      </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;bean</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">id=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"helloBean"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 10.1pt; TEXT-INDENT: 70pt; TEXT-ALIGN: left; mso-layout-grid-align: none; mso-char-indent-count: 7.0; mso-para-margin-left: .96gd" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">class=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"com.kela.spring.helloword.HelloBean"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 2">       </span>
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;property</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">name=</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">"helloWord"</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 3">           </span>
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;value&gt;</span>
				<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">你好，</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">Spring</span>
				<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">爱好者！</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/value&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 2">       </span>
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/property&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">
						<span style="mso-tab-count: 1">    </span>
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/bean&gt;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 20pt; mso-char-indent-count: 2.0">
				<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: #0000e1; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">&lt;/beans&gt;</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 39pt; TEXT-INDENT: -18pt; mso-list: l0 level2 lfo1; tab-stops: list 39.0pt">
				<span lang="EN-US" style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">
						<span style="mso-list: Ignore">●<span style="FONT: 7pt 'Times New Roman'">     </span></span>
				</span>
				<span lang="EN-US">TestClass.java</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>package com.kela.spring.helloword;</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">import org.springframework.context.ApplicationContext;</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">import org.springframework.context.support.FileSystemXmlApplicationContext;</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">public class TestClass {</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-tab-count: 1">       </span>
						<span style="mso-spacerun: yes">    </span>public static void main(String[] args) {</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-tab-count: 2">              </span>
						<span style="mso-spacerun: yes">    </span>try {</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-tab-count: 3">                     </span>
						<span style="mso-spacerun: yes">    </span>ApplicationContext context = new </span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 26.25pt; mso-char-indent-count: 2.5">
				<span lang="EN-US">FileSystemXmlApplicationContext("bin\\com\\kela\\spring\\helloword\\beans-config.xml");</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-tab-count: 3">                     </span>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-tab-count: 3">                     </span>
						<span style="mso-spacerun: yes">    </span>HelloBean helloBean = (HelloBean)context.getBean("helloBean");</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-tab-count: 3">                     </span>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-tab-count: 3">                     </span>
						<span style="mso-spacerun: yes">    </span>System.out.println("</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">打印欢迎词：</span>
				<span lang="EN-US">" + helloBean.getHelloWord());</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-tab-count: 2">              </span>
						<span style="mso-spacerun: yes">    </span>} catch (Exception e) {</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-tab-count: 3">                     </span>
						<span style="mso-spacerun: yes">    </span>System.out.println("[ERROR]" + e.getMessage());</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-tab-count: 2">              </span>
						<span style="mso-spacerun: yes">    </span>}</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-tab-count: 1">       </span>
						<span style="mso-spacerun: yes">    </span>}</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">}</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="mso-fareast-font-family: 'Times New Roman'">
								<span style="mso-list: Ignore">3.<span style="FONT: 7pt 'Times New Roman'">       </span></span>
						</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">测试</span>
						<span lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行</span>
				<span lang="EN-US">TestClass.java</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件，内容如下：</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">打印欢迎词：你好，</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">Spring</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">爱好者！</span>
						<span lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt">
				<span lang="EN-US" style="mso-fareast-font-family: 'Times New Roman'">
						<span style="mso-list: Ignore">4.<span style="FONT: 7pt 'Times New Roman'">       </span></span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
						<strong>学习小结</strong>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">通过配置的形式，对</span>
				<span lang="EN-US">HelloBean.java</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件中属性</span>
				<span lang="EN-US">helloWord</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">注入了一段文件（你好，</span>
				<span lang="EN-US">spring</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">爱好者），</span>
				<span lang="EN-US">HelloBean.java</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件中没有任何与</span>
				<span lang="EN-US">Spring</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有关的东西，在测试类中对</span>
				<span lang="EN-US">HelloBean</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的声明是由</span>
				<span lang="EN-US">Spring</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">自动完成的。</span>
		</p>
<img src ="http://www.blogjava.net/kela/aggbug/64725.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kela/" target="_blank">Kela</a> 2006-08-21 10:23 <a href="http://www.blogjava.net/kela/articles/64725.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>