*创建Spring框架hello world项目的过程:
1.导入项目所需的最小配置的jar包:共5个,一个日志包,剩下四个为:core,context,bean,expression
2.创建各种你应用程序需要的beans
3.在src目录下,创建Spring的bean配置文件,并且在其中配置你要配置的beans
4.在需要获取bean的地方,首先获取应用程序上下文(bean的IoC容器...
分类:
编程语言 时间:
2016-05-03 10:48:34
阅读次数:
295
以前有对xsd小做研究,有个小困惑,就是我们定义的元素只能使用定义的哪一些标签,比如<beans>下面就只能有自定义的哪一些,那为什么在引入<context>、<aop>等命名空间之后就能使用上诉2个标签呢?之前一直嫌弃spring的xsd太长,第一眼看上去比较混乱,今天鼓起勇气看了一下<beans ...
分类:
编程语言 时间:
2016-05-03 02:01:51
阅读次数:
205
要注意spring 版本与jdk的兼容性 applicationContext-resource.xml: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XML ...
分类:
编程语言 时间:
2016-05-01 13:34:31
阅读次数:
178
applicationContext-resource.xml: <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://ww ...
分类:
编程语言 时间:
2016-05-01 13:28:49
阅读次数:
172
maven dependencies中并不会删除 以下方法maven dependencies中并不会删除,可能程序引入的时候,会去掉这种依赖(猜的) 解释: 就是说项目中要用到某一个a.jar包,通过maven引入了之后,也自动的导入了该jar包所依赖的包,这里就会存在一个问题, 如果a.jar包 ...
分类:
编程语言 时间:
2016-05-01 01:12:35
阅读次数:
207
ApplicationContext ctx = new ClassPathXmlApplicationContext("test.xml");报错 在启动Spring时,报以下错误,如图: 原因是在xml中spring的xsd的版本配置的不一致,我使用的是spring-2.5.6,但配置文件中配的 ...
分类:
编程语言 时间:
2016-05-01 01:02:11
阅读次数:
282
DP。 先dp处理出每一行能得到的最大价值,再dp选择哪几行获得最大价值。 行列选择的本质是一样的操作。 ...
分类:
其他好文 时间:
2016-04-30 14:20:39
阅读次数:
101
Spring的配置详解3.1XML配置的结构<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"...
分类:
编程语言 时间:
2016-04-29 20:01:41
阅读次数:
281
JPA Repositories简介Spring命名空间
SpringData使用了自定义的命名空间去定义repository。通常我们会使用repositories元素:
<beans xmlns="http://www.springframework.org/schema/beans"
xm...
分类:
编程语言 时间:
2016-04-29 15:09:47
阅读次数:
876
SpringContextUtil类 package com.common.util; import org.springframework.beans.BeansException;import org.springframework.beans.factory.NoSuchBeanDefinit ...
分类:
编程语言 时间:
2016-04-28 14:10:30
阅读次数:
612