<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>隔叶黄莺 Unmi Blog &#187; Spring</title>
	<atom:link href="http://unmi.cc/category/javajee/spring/feed" rel="self" type="application/rss+xml" />
	<link>http://unmi.cc</link>
	<description></description>
	<lastBuildDate>Wed, 22 Feb 2012 14:20:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Spring MVC 碰到 java.lang.NoSuchFieldError: APPLICATION_CONTEXT_ID_PREFIX</title>
		<link>http://unmi.cc/spring-mvc-%e7%a2%b0%e5%88%b0-java-lang-nosuchfielderror-application_context_id_prefix</link>
		<comments>http://unmi.cc/spring-mvc-%e7%a2%b0%e5%88%b0-java-lang-nosuchfielderror-application_context_id_prefix#comments</comments>
		<pubDate>Mon, 23 May 2011 15:02:31 +0000</pubDate>
		<dc:creator>Unmi</dc:creator>
				<category><![CDATA[Spring]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://unmi.cc/?p=3600</guid>
		<description><![CDATA[Spring MVC 应用在 Tomcat 启动的时候出现了下面的错误： java.lang.NoSuchFieldError: APPLICATION_CONTEXT_ID_PREFIX  at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:430)  at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)  at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)  at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)  at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)  at javax.servlet.GenericServlet.init(GenericServlet.java:212)  at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)  at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)  at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)  at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)  at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)  at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)  at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)  at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)  at org.apache.catalina.core.StandardService.start(StandardService.java:519)  at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)  at org.apache.catalina.startup.Catalina.start(Catalina.java:581)  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)  at java.lang.reflect.Method.invoke(Method.java:597)  at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)  at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) 2011-5-23 [...]]]></description>
		<wfw:commentRss>http://unmi.cc/spring-mvc-%e7%a2%b0%e5%88%b0-java-lang-nosuchfielderror-application_context_id_prefix/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring 2.0可扩展XML配置初探[转]</title>
		<link>http://unmi.cc/spring-xml-custom-schema</link>
		<comments>http://unmi.cc/spring-xml-custom-schema#comments</comments>
		<pubDate>Mon, 21 Feb 2011 12:30:42 +0000</pubDate>
		<dc:creator>Unmi</dc:creator>
				<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://unmi.cc/?p=3208</guid>
		<description><![CDATA[本文通过一个简单的例子，说明如何去扩展XML配置，它大致需要的几个步骤。具体的需求是使用自定义标签定义一个简单的bean，这个bean有一个或多个属性，标签定义完成后，可以在其他项目中用自定义标签来定义该bean。 Spring 2.0版本支持扩展XML配置，着实兴奋了一下，在我看来，Spring作为目前最流行的框架，不能扩展用户自定义的配置，实在是Spring的一个很不爽的地方，的方式用起来比较通用，起码到目前为止符合大部分人的使用习惯，并且能完成Spring所有的配置操作，但是对于第三方的提供商或则会经常扩展Spring功能的开发者来说，使用这样的配置方式或许不是他们最想要的，他们需要使组件的配置更加直观、易阅读、易扩展……试想使用下面的配置方式。 &#60;mytag:datasource id="datasource"                   databaseType="oracle"                   ip="192.168.1.110"                   port="1521"                   databaseName="myDB"                   userName="admin"                   password="password" /&#62; &#60;mytag:ehCache id="ehcache"                cache="true"                maxElements="100000"                timeToIdleSeconds="120"                timeToLiveSeconds="120"                overflowToDisk="true" /&#62;  上面的代码中配置了两个组件，datasource和cache组件，相比普通的bean&#38;propertiy方式，很显然，这种配置方式更直观，更易读，更重要的是，如果作为组件发布，使用者也可以很方便快捷的开始使用，而不需要关心组件的任何实现细节。 扩展XML配置大致需要一下几个步骤： 1、创建一个需要扩展的组件 2、定义一个xsd文件描述组件内容 3、创建一个文件，实现BeanDefinitionParser接口，用来解析xsd文件中的定义和组件定义 4、创建一个Handler文件，扩展自NamespaceHandlerSupport，目的是将组件注册到Spring容器 5、编写spring.handlers和spring.schemas文件 提供一个简单的例子，来说明如何去扩展一个Spring配置，需求如下：使用自定义标签定义一个简单的bean，这个bean有一个或多个属性，标签定义完成后，可以在其他项目中用自定义标签来定义该bean。 首先，创建一个需要扩展的组件，在这里只是一个简单的bean，而且这个bean只有一个属性age。 One.java package com.mysite.tag; public class One {     private String age;     public One() { [...]]]></description>
		<wfw:commentRss>http://unmi.cc/spring-xml-custom-schema/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring 中如何向 Bean 注入系统属性或环境变量</title>
		<link>http://unmi.cc/spring-injection-system-properties-env</link>
		<comments>http://unmi.cc/spring-injection-system-properties-env#comments</comments>
		<pubDate>Wed, 26 Jan 2011 06:29:03 +0000</pubDate>
		<dc:creator>Unmi</dc:creator>
				<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://unmi.cc/?p=3094</guid>
		<description><![CDATA[在 Spring 中为 javabean 注入属性文件中的属性值一般人都知道的，可以通过 org.springframework.beans.factory.config.PropertyPlaceholderConfigurer 引入一个属性文件，然后给 bean 指定属性的时候就可以用 ${jdbc.url} 方式赋值了。比如在 Spring 中是这样的配置： &#60;bean id="propertyConfigurer"    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&#62;     &#60;property name="locations"&#62;         &#60;list&#62;             &#60;value&#62;classpath:jdbc.properties&#60;/value&#62;         &#60;/list&#62;     &#60;/property&#62; &#60;/bean&#62; &#60;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"     destroy-method="close"&#62;     &#60;property name="url" value="${jdbc.url}"/&#62;     &#60;property name="username" value="${jdbc.username}"/&#62; &#60;/bean&#62; 只是有时候我们需要给 bean 赋上系统属性(System.getProperties() ) 中的值或环境变量(System.getenv() ) 中的值，根据程序所处的环境产生不同的行为，这样我们无法事先在某个 properties 文件预先设定好值的。 这种需求也是不怕做不到就怕想不到，基于此，既然上面是用 PropertyPlaceholderConfigurer 来读取属性文件，那么有没有像 EnvironmentPlaceholderConfigurer [...]]]></description>
		<wfw:commentRss>http://unmi.cc/spring-injection-system-properties-env/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring JdbcTemplate 调用存储过程</title>
		<link>http://unmi.cc/spring-jdbctemplate-call-procedure</link>
		<comments>http://unmi.cc/spring-jdbctemplate-call-procedure#comments</comments>
		<pubDate>Mon, 24 Jan 2011 12:49:11 +0000</pubDate>
		<dc:creator>Unmi</dc:creator>
				<category><![CDATA[Spring]]></category>
		<category><![CDATA[dao]]></category>
		<category><![CDATA[jdbctemplate]]></category>

		<guid isPermaLink="false">http://unmi.cc/?p=3077</guid>
		<description><![CDATA[以前一篇中写到了 hibernate 调用存储过程，这里介绍 Spring 借道 JdbcTemplate 如何调用数据库存储过程。还是以前面的那个 DB2 存储过程为例，该过程的代码如下： CREATE  procedure selectAllUsers(IN piAge INTEGER) DYNAMIC RESULT SETS 1 BEGIN       DECLARE temp_cursor1 CURSOR  WITH RETURN TO CLIENT  FOR       SELECT * FROM  test where age &#60; piAge;       OPEN temp_cursor1; END; 这个过程中最后一行直接打开了一个游标，也就是返回了一个结果集。调用存储过程的方法应该看看 org.springframework.jdbc.core.JdbcTemplate 的各个 execute() 方法，具体点就是带了 CallableStatementCallback&#60;T&#62; 参数的那两个 execute()，究底的话又归结为其中之一。看下这两个 execute() 方法，摘自代码 Spring 3.0.5 的 org.springframework.jdbc.core.JdbcTemplate: [...]]]></description>
		<wfw:commentRss>http://unmi.cc/spring-jdbctemplate-call-procedure/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>引入了 struts2-spring-plugins 包后 Spring 就会管理你的 Action</title>
		<link>http://unmi.cc/struts2-spring-plugins-action</link>
		<comments>http://unmi.cc/struts2-spring-plugins-action#comments</comments>
		<pubDate>Thu, 20 Jan 2011 11:51:04 +0000</pubDate>
		<dc:creator>Unmi</dc:creator>
				<category><![CDATA[Spring]]></category>
		<category><![CDATA[Struts2]]></category>

		<guid isPermaLink="false">http://unmi.cc/?p=3063</guid>
		<description><![CDATA[Struts2 与 Spring 结合，使用 Spring 来管理 Action 实例，在项目中引入了struts2-spring-plugin-2.2.1.jar 包。然后想到的是既然是要用 Spring 来管理 Action 实例，就得在 struts.xml 里加上： &#60;constant name="struts.objectFactory" value="spring" /&#62; 或者是在 struts.properties 里加上一条属性： struts.objectFactory = spring OK，这也没问题，然而有次在某个测试项目中想暂时不用 Spring 来管理 Bean，于是把上面的配置去了，也把 web.xml 中的相关 Spring 的 ContextLoaderListener 也格啦。容器启动的时候却发现： INFO: Initializing Struts-Spring integration... Jan 20, 2011 7:32:08 PM org.apache.struts2.spring.StrutsSpringObjectFactory &#60;init&#62; SEVERE: ********** FATAL ERROR STARTING UP STRUTS-SPRING INTEGRATION ********** [...]]]></description>
		<wfw:commentRss>http://unmi.cc/struts2-spring-plugins-action/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring 3.0.5.RELEASE 版悄无声息的发布了</title>
		<link>http://unmi.cc/spring-3-0-5-release</link>
		<comments>http://unmi.cc/spring-3-0-5-release#comments</comments>
		<pubDate>Mon, 25 Oct 2010 17:13:34 +0000</pubDate>
		<dc:creator>Unmi</dc:creator>
				<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://unmi.cc/spring-3-0-5-release</guid>
		<description><![CDATA[Spring 3.0.5 Release 版在 2010-10-20 悄然发布，真正支持了 Hibernate 3.6 Final。在常去的几个网站都没看到相关信息，而且在 Spring 的官方网站上也是小声细作，好不容易才翻出一个 changelog 出来：http://static.springsource.org/spring/docs/3.0.x/changelog.txt。 可在 http://ebr.springsource.com/repository/app/bundle/version/detail?name=org.springframework.core&#38;version=3.0.5.RELEASE 下载， 假如你是用 Ivy 管理依赖，请添加： &#60;dependency org="org.springframework" name="org.springframework.core" rev="3.0.5.RELEASE" /&#62; 用 Maven 管理依赖的话，pom.xml 加： &#60;dependency&#62; &#160;&#160;&#160;&#160;&#60;groupId&#62;org.springframework&#60;/groupId&#62; &#160;&#160;&#160;&#160;&#038;&#60;artifactId&#62;org.springframework.core&#60;/artifactId&#62; &#160;&#160;&#160;&#160;&#038;&#60;version&#62;3.0.5.RELEASE&#60;/version&#62; &#60;/dependency&#62; 还有作为 OSGI Bundle 的引入方式，MANIFEST.MF 中： Import-Bundle: org.springframework.core;version="[3.0.5.RELEASE,3.0.5.RELEASE]" 为何我对该版本如此关注呢？主要是原来在使用 Spring 3.0.4 MVC 的 &#60;mvc:resources location="/" mapping="/resources/**"/&#62; &#60;!-- Allows for mapping the DispatcherServlet to [...]]]></description>
		<wfw:commentRss>http://unmi.cc/spring-3-0-5-release/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Spring 学习点滴，《Spring in Action》笔记（七）</title>
		<link>http://unmi.cc/spring-in-action-notes-7</link>
		<comments>http://unmi.cc/spring-in-action-notes-7#comments</comments>
		<pubDate>Tue, 07 Oct 2008 15:12:00 +0000</pubDate>
		<dc:creator>Unmi</dc:creator>
				<category><![CDATA[Spring]]></category>
		<category><![CDATA[Action]]></category>

		<guid isPermaLink="false">http://unmi.cc/uncategorized/spring-%e5%ad%a6%e4%b9%a0%e7%82%b9%e6%bb%b4%ef%bc%8c%e3%80%8aspring-in-action%e3%80%8b%e7%ac%94%e8%ae%b0%ef%bc%88%e4%b8%83%ef%bc%89</guid>
		<description><![CDATA[91. Spring MVC 还提供了一个特别点的 Controller 类型就是 ThrowawayController，它自成一个接口，ThrowawayController 和 Controller 的关系是平行的。什么叫做 ThrowawayController 呢，中文叫做一次性控制器，也就像一次性筷子那样用完即丢，下次要用又拿新的。表现在实例上就是相应 Bean 配置为 singleton="false"，每次初始化一个新实例。与其他 Controller 的区别完全就是 WebWork 或 Struts2 的 Action 与 Struts1 的 Action 的区别。因为它是多例的，所以可以用实例变量来接受请求参数，执行方法无参数；而不像其他的 Controller ，因为共享实例，所以需要通过执行方法的来传递请求参数以保证线程安全（P273） 92. 在《Spring in Action》第一版 274 页说 DispatcherServlet 使用缺省 ControllerHandlerAdapter 时只会把控制权分发给 Controller 接口类型的类，而要配置 ThrowawayControllerHandlerAdapter 后，Dispatcherservlet 就把控制权分发给 ThrowawayController，配置如下： &#60;bean id="throwawayHandler" class="org.springframework.web.servlet.mvc.throwaway.ThrowawayControllerHandlerAdapter" /&#62; 同时要是应用系统中要混用两种控制器的话，还得在前面的基础上配置一个 SimpleControllerHandlerAdapter，配置如下： &#60;bean id="simpleHandler" class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" /&#62; 然而我在实际测试中，仍用缺省的 ControllerHandlerAdapter，同样能在一个应用中混合使用两种类型的控制器，尚不知不加上面那两个配置会出什么问题(P274) 93. [...]]]></description>
		<wfw:commentRss>http://unmi.cc/spring-in-action-notes-7/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Spring 整合 Hibernate 的一处简化配置［转］</title>
		<link>http://unmi.cc/spring-integrate-hibernate-simple</link>
		<comments>http://unmi.cc/spring-integrate-hibernate-simple#comments</comments>
		<pubDate>Mon, 20 Aug 2007 08:00:00 +0000</pubDate>
		<dc:creator>Unmi</dc:creator>
				<category><![CDATA[Spring]]></category>
		<category><![CDATA[Hibernate]]></category>

		<guid isPermaLink="false">http://unmi.cc/uncategorized/spring-%e6%95%b4%e5%90%88-hibernate-%e7%9a%84%e4%b8%80%e5%a4%84%e7%ae%80%e5%8c%96%e9%85%8d%e7%bd%ae%ef%bc%bb%e8%bd%ac%ef%bc%bd</guid>
		<description><![CDATA[在过去使用 Spring 整合 Hibernate 的时候，都是用这样的配置方式。 &#60;bean id ="sessionFactory" lazy-init ="true" class ="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&#62; &#60;property name ="mappingResources"&#62; &#60;list&#62; &#60;value&#62;resources/icustomer/Contact.hbm.xml&#60;/value&#62; &#60;value&#62;resources/icustomer/Customer.hbm.xml&#60;/value&#62; &#60;/list&#62; &#60;/property&#62; ................... &#60;/bean&#62; 每当需要加入一个新的 VO 时，我需要过来修改配置文件，来引入对新的 VO 的支持。 现在我使用的时候，是这么配的： &#60;bean id ="sessionFactory" lazy-init ="true" class ="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&#62; &#60;property name ="mappingLocations" &#62; &#60;list&#62; &#60;value &#62; classpath:resources/**/*.hbm.xml &#60;/value&#62; &#60;/list&#62; &#60;/property&#62; ..................... &#60;/bean&#62; 做项目开发的时候，就再也没有改过配置。 &#60;property name="mappingDirectoryLocations"&#62; &#60;list&#62; &#60;value&#62;classpath*:domain/mappings/&#60;/value&#62; &#60;/list&#62; &#60;/property&#62; [...]]]></description>
		<wfw:commentRss>http://unmi.cc/spring-integrate-hibernate-simple/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Spring 学习点滴，《Spring in Action》笔记（六）</title>
		<link>http://unmi.cc/spring-in-action-notes-6</link>
		<comments>http://unmi.cc/spring-in-action-notes-6#comments</comments>
		<pubDate>Sat, 16 Jun 2007 12:56:00 +0000</pubDate>
		<dc:creator>Unmi</dc:creator>
				<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://unmi.cc/uncategorized/spring-%e5%ad%a6%e4%b9%a0%e7%82%b9%e6%bb%b4%ef%bc%8c%e3%80%8aspring-in-action%e3%80%8b%e7%ac%94%e8%ae%b0%ef%bc%88%e5%85%ad%ef%bc%89</guid>
		<description><![CDATA[81. Spring 提供了丰富的控制器层次，方便根据实际需求选择实现或继承那一种控制器。不像 Struts 和 WebWork 比较平坦的 Action 层次。比如 ThowawayController/MultiActionController/SimpleFormController 等。 (P254) 82. 继承 AbstractController 要覆盖的方法是 handleRequestInternal(request,response)；new ModelAndView("counrseList","courses",courses) 第一个参数是 view 的逻辑名，第二第三个参数是传递给 view 的名称/数值对，那要向 View 传递多个参数就还是要用 request.setAttribute() 了。(P256) 83. 当控制器需要根据参数执行工作时，如参数绑定到业务对象，插入验证器的钩子，应该继承 AbstractCommandController，你的 Controller 中需要覆盖 handle(request,response,Object command,BindException) 方法，这个方法还需带一个控制器命令参数，并且需要在构造函数中指定命令类，如 public MyController(){ setCommandClass(MyCommand.class); } 在使用 command 对象与 Struts 中的 ActionForm是一样的，也是通过处理方法来传递的，在 handle 方法中用 MyCommand myCommand = (MyCommand)command。 命令对象只是一个 POJO，功能相当于 Struts 的 ActionForm，能匹配接受请求中的参数，它不需要在 [...]]]></description>
		<wfw:commentRss>http://unmi.cc/spring-in-action-notes-6/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring 学习点滴，《Spring in Action》笔记（五）</title>
		<link>http://unmi.cc/spring-in-action-notes-5</link>
		<comments>http://unmi.cc/spring-in-action-notes-5#comments</comments>
		<pubDate>Sat, 16 Jun 2007 08:50:00 +0000</pubDate>
		<dc:creator>Unmi</dc:creator>
				<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://unmi.cc/uncategorized/spring-%e5%ad%a6%e4%b9%a0%e7%82%b9%e6%bb%b4%ef%bc%8c%e3%80%8aspring-in-action%e3%80%8b%e7%ac%94%e8%ae%b0%ef%bc%88%e4%ba%94%ef%bc%89</guid>
		<description><![CDATA[第八章. 建立 Web 层 71. Spring 的 MVC 和 Struts 的 MVC 基本一致     Spring 的控制流程是：请求-&#62;DispatcherServlet-&#62;从 HandlerMapping 中查询到处理该请求的 Controller-&#62; Controller 的 handleRequest 方法调用业务方法，最后返回 ModelAndView (ModelAndView告诉了 DispatcherServlet 转向到哪个视图)     Struts 的控制流程是：请求-&#62;ActionServlet-&#62;从 ActionMapping 中查询到处理该请求的 Controller (Action类)-&#62;Action 的execute 方法调用业务方法，最后返回 ActionForward (ActionForward告诉了 ActionServlet 该转向到哪个视图)(P243) 72. Spring 的 DispatcherServlet 和 Struts 的 ActionServlet 的配置方式是一样的，都是作为一个自启动的 Servlet 配置到 web.xml 中。Spring 的 url-pattern [...]]]></description>
		<wfw:commentRss>http://unmi.cc/spring-in-action-notes-5/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring 学习点滴，《Spring in Action》笔记（四）</title>
		<link>http://unmi.cc/spring-in-action-notes-4</link>
		<comments>http://unmi.cc/spring-in-action-notes-4#comments</comments>
		<pubDate>Thu, 07 Jun 2007 15:53:00 +0000</pubDate>
		<dc:creator>Unmi</dc:creator>
				<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://unmi.cc/uncategorized/spring-%e5%ad%a6%e4%b9%a0%e7%82%b9%e6%bb%b4%ef%bc%8c%e3%80%8aspring-in-action%e3%80%8b%e7%ac%94%e8%ae%b0%ef%bc%88%e5%9b%9b%ef%bc%89</guid>
		<description><![CDATA[61. 更为精彩的是自动代理的方式来总体配置各分散类中方法的事物属性，结合使用 DefaultAdvisorAutoProxyCreator, TransactionAttributeSourceAdvisor 和 TransactionInterceptor （我还需要详细理清楚）(P181) 62. 当使用自动代理时，MethodMapTransationAttributeSource 就能很多的派上用场了，它的 methodMap 属性中可以指定哪个类的哪个方法，可以使用通配符(P182) 第七章. 访问企业服务 63. 对于 JndiObjectFactoryBean 查找 jndi  资源未提及，如何设置 jndiEnvironment 属性，如果是在J2EE容器中运行，没什么问题，只是以单独应用程序运行时却未加说明，如下在容器外运行需要加上 jndiEnvironment 配置，指定实现类，及URL等(P217) &#60;property name="jndiEnvironment"&#62; &#60;props&#62; &#60;prop key="java.naming.factory.initial"&#62; org.apache.naming.java.javaURLContextFactory &#60;/prop&#62; &#60;prop key="java.naming.factory.url.pkgs"&#62; org.apache.naming &#60;/prop&#62; &#60;/props&#62; &#60;/property&#62; 64.发送电子邮件配置 SimpleMailMessage 时也未说明，如果 SMTP 发送前需要验证该如何配置。需加上 mail.smtp.auth属性为 true，和验证时用户名和密码，Spring 验证时是通过 getTransport("smtp").connect(host,user,passwd) 来验证的。(P218) &#60;bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"&#62; &#60;property name="javaMailProperties"&#62; &#60;props&#62; &#60;prop key="mail.smtp.auth"&#62;true&#60;/prop&#62; &#60;/props&#62; &#60;/property&#62; &#60;property [...]]]></description>
		<wfw:commentRss>http://unmi.cc/spring-in-action-notes-4/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring 学习点滴，《Spring in Action》笔记（三）</title>
		<link>http://unmi.cc/spring-in-action-notes-3</link>
		<comments>http://unmi.cc/spring-in-action-notes-3#comments</comments>
		<pubDate>Sun, 03 Jun 2007 17:11:00 +0000</pubDate>
		<dc:creator>Unmi</dc:creator>
				<category><![CDATA[Spring]]></category>
		<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://unmi.cc/uncategorized/spring-%e5%ad%a6%e4%b9%a0%e7%82%b9%e6%bb%b4%ef%bc%8c%e3%80%8aspring-in-action%e3%80%8b%e7%ac%94%e8%ae%b0%ef%bc%88%e4%b8%89%ef%bc%89</guid>
		<description><![CDATA[第十章. 使用其他 Web 框架 41. Spring 提供了两种与 Struts 集成的方式     1) 让你的 Action 继承 org.springframework.web.struts.ActionSupport     2) 将请求委托给作为 Spring Bean 管理的 Struts action 来自理(P312) 42. 为了让 Struts 能访问 Spring 管理的 Bean，必须在 struts-config.xml 中注册一个知道 Spring 上下文的 ContextLoaderPlugIn，用的是 WebApplicationContext：(P312) &#60;plug-in className="org.springframework.web.struts.ContextLoaderPlugIn"&#62; &#60;set-property="contextConfigLocation" value="/WEB-INF/training-servlet.xml,/WEB-INF/..."/&#62; &#60;/plugin-in&#62; 43.  ActionSupport 重载了 setServlet()方法，获取bean的方式为调用 ActionSupport 的 getWebApplicationContext().getBean() (P313) 44. 继承 Spring 提供的 ActionSupport 让 Struts与Spring 紧密耦合，而且 [...]]]></description>
		<wfw:commentRss>http://unmi.cc/spring-in-action-notes-3/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring 学习点滴，《Spring in Action》笔记（二）</title>
		<link>http://unmi.cc/spring-in-action-notes-2</link>
		<comments>http://unmi.cc/spring-in-action-notes-2#comments</comments>
		<pubDate>Sun, 03 Jun 2007 14:06:00 +0000</pubDate>
		<dc:creator>Unmi</dc:creator>
				<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://unmi.cc/uncategorized/spring-%e5%ad%a6%e4%b9%a0%e7%82%b9%e6%bb%b4%ef%bc%8c%e3%80%8aspring-in-action%e3%80%8b%e7%ac%94%e8%ae%b0%ef%bc%88%e4%ba%8c%ef%bc%89</guid>
		<description><![CDATA[第四章. 征服数据库 31. Spring 把数据访问流程中的固定部分和可变部分分开，分别映射成两截然不同的类，模板（Template）和回调（Callback），模板管事物控制、资源管理以及异常处理；回调实现特定于应用的部分--创建 statement、绑定参数、以及整理结果集。模板方法模式的优秀应用（P123） 32. JdbcTemplate template = new JdbcTemplate(myDataSource); 构造。 所有 Spring Dao 模板类是线程安全的，可以为每一个 DAO 配置一个 JdbcTemplate 属性，也可以让 DAO 类继承 JdbcDaoSupport，然后在 DAO 类中用 getJdbcTemplate() 获取到 JdbcTemplate 进行数据库操作。书中的做法是给每个 Dao 加一个 JdbcTemplate 属性，记录的日志略有不同，实际中注意(P127) 33. JdbcTemplate 的 execute() 方法不可带 sql  参数，即不存在 execute(String sql, Object[] params) 方法，而 update 才有 update(String sql, Object[] params) 方法可以，还能指定每一字段的类型(通过第三个参数 int[] argTypes)，保证了类型安全，130页说 JdbcTemplate [...]]]></description>
		<wfw:commentRss>http://unmi.cc/spring-in-action-notes-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring 学习点滴，《Spring in Action》笔记（一）</title>
		<link>http://unmi.cc/spring-in-action-notes-1</link>
		<comments>http://unmi.cc/spring-in-action-notes-1#comments</comments>
		<pubDate>Sun, 03 Jun 2007 05:47:00 +0000</pubDate>
		<dc:creator>Unmi</dc:creator>
				<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://unmi.cc/uncategorized/spring-%e5%ad%a6%e4%b9%a0%e7%82%b9%e6%bb%b4%ef%bc%8c%e3%80%8aspring-in-action%e3%80%8b%e7%ac%94%e8%ae%b0%ef%bc%88%e4%b8%80%ef%bc%89</guid>
		<description><![CDATA[第二章：装配 Bean 1. &#60;ref&#62;标签中的 bean, local, parent 三个属性的区别(P53) 2. &#60;list&#62;&#60;value...&#60;/list&#62;和&#60;set&#62;&#60;value...&#60;/set&#62;可以换着用都可以为 List, Set 以及数组属性赋值(P55) 3. &#60;map&#62;属性用 spring  进行装匹时 key 值只能是字符串类型，不过一般能满足要求(P55) 4. 装配 map 属性要用 &#60;entry key="key1"&#62;&#60;value&#62;foo&#60;/value&#62;&#60;/entry&#62;, 而装匹 properties 属性可以写成 &#60;prop key="key1"&#62;foo&#60;/prop&#62;, 这是因为 properties 的值总是字符串，而 map 中很随意(P55) 5. 用 &#60;property name="foo"&#62;&#60;null/&#62;&#60;/property&#62; 形式设置属性为 null, 区别为字符串 "null"(P56) 6. 通过构造函数注入依赖时，对多参数需要借助于 index 或 type 属性来指定对应哪个参数，index 属性能应付所有情况(P58) 7. 可为 bean 设置 autowire为四个值， byName, byType, [...]]]></description>
		<wfw:commentRss>http://unmi.cc/spring-in-action-notes-1/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 11/77 queries in 0.034 seconds using disk: basic
Object Caching 4035/4167 objects using disk: basic

Served from: unmi.cc @ 2012-02-23 07:51:44 -->
