今天老大让把项目测试环境,开发环境,生成环境配置一下,方便数据源切换,很惊喜的找到了spring3.1的profile,使用这个标签太方便了。 Spring 3.1的功能,以后就不用为了区分Test, Dev, Production环境,搞几个只...
分类:
编程语言 时间:
2014-09-19 15:47:46
阅读次数:
575
装配:创建应用对象之间的协作关系的行为。这也是依赖注入的本质。1、声明BeanJAVA多种命名空间 命名空间用途aop为声明切面以及注解的类代理为spring切面提供配置元素。beans支持声明Bean和装配Bean。context为配置spring应用上下文提供配置元素。jee提供了与JAVA E...
分类:
其他好文 时间:
2014-09-19 11:25:55
阅读次数:
150
Spring整合JDBC实现简单的增删改1.导入Spring的包和数据库的驱动包;2.选择一个数据源(dbcp和C3P0)3.导入数据源的包(这里我们使用dbcp)4.在beans.xml中创建dataSource数据源5.创建一个jdbc.properties文件存储数据库连接信息6.在beans.xml中导入相应的jdbc.properties文件7.写相应的DAO,并且为这个DAO创建一个JdbcTemplate对象,通过JdbcTemplate对象可以方便的完成对数据库的操作8.为DAO注入相应的D...
分类:
数据库 时间:
2014-09-18 09:51:33
阅读次数:
338
spring_aop_annotation 的实现:
1.1在beans.xml中加入aop的schema
1.2在xml中打开aop的自动检索
1.3创建一个需要实现动态代理的类
1.4导入aspectj包,Spring使用的是aspect这个包来实现AOP,所以需要导入这个包。
1.5在这类上面使用@Aspect来声明这个类是一个切面类
1.6在相应的要进行横切点上面加入PointCut的说明
1.7如果希望获取相应的调用信息,可以通过joinPoint 传递...
分类:
编程语言 时间:
2014-09-17 10:22:52
阅读次数:
296
package cn.jbit.util;
import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
import java.lang.ref...
分类:
其他好文 时间:
2014-09-16 17:24:51
阅读次数:
188
同理 org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:?Line?52?in?XML?document?from?class?path?resource?[bean.xml]?is?invalid;?nested?exception?is?org.xml.sax.S...
分类:
Web程序 时间:
2014-09-16 16:14:00
阅读次数:
859
wp7.1APIsIsolated Storage Classes?独立存储类在System.IO.IsolatedStorage命名空间中?IsolatedStorageFile?表示包含文件和目录的独立存储区?IsolatedFileStream?公开独立存储中的文件Saving Data代码p...
分类:
其他好文 时间:
2014-09-16 12:14:00
阅读次数:
201
global.dao.dbcp.xml:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx...
分类:
其他好文 时间:
2014-09-15 17:56:09
阅读次数:
254
1、创建Spring配置
在XML文件中声明Bean时,Spring配置文件的根元素来源于Spring beans命名空
间所定义的元素。以下为一个典型的Spring XML配置文件:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema...
分类:
其他好文 时间:
2014-09-15 11:19:48
阅读次数:
228
一个 Bound 属性是指当该种属性的值发生变化时,要通知其它的对象。每次属性值改变时,这种属性就点火一个PropertyChange事件(在Java程序中,事件也是一个对象)。事件中封装了属性名、属性的原值、属性变化后的新值。这种事件是传递到其它的Beans,至于接收事件的Beans 应做什么动作...
分类:
Web程序 时间:
2014-09-13 15:55:15
阅读次数:
211