摘要: 1 配置文件的方法 我们编写spring 框架的代码时候。一直遵循是这样一个规则:所有在spring中注入的bean 都建议定义成私有的域变量。并且要配套写上 get 和 set方法。 Boss 拥有 Office 和 Car 类型的两个属性: 清单 3. Boss.java 我们在 Spring 阅读全文
posted @ 2016-03-16 12:28 北方乐逍遥 阅读(768) 评论(0) 推荐(0) 编辑
摘要: <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/config/application-context.xml /WEB-INF/config/cache-context.xml 阅读全文
posted @ 2016-03-16 11:51 北方乐逍遥 阅读(495) 评论(0) 推荐(0) 编辑
摘要: ContextLoaderListener监听器的作用就是启动Web容器时,自动装配ApplicationContext的配置信息。因为它实现了ServletContextListener这个接口,在web.xml配置这个监听器,启 动容器时,就会默认执行它实现的方法。至于ApplicationCo 阅读全文
posted @ 2016-03-16 10:58 北方乐逍遥 阅读(301) 评论(0) 推荐(1) 编辑