摘要: 1、导入Spring的包(spring的dist中的jar包和commons-logging包)和数据库的驱动包2、选择一个数据源(DBCP和C3p0)3、导入数据源的包:DBCP (commons-dbcp-jar,commons-pool.jar)4、在beans.xml中创建dataSource数据源 <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property na 阅读全文
posted @ 2013-03-10 21:07 Jojojojoo 阅读(357) 评论(0) 推荐(0) 编辑
摘要: 1。假设你已经配好依赖注入那一块。此时的bean.xml为 <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" 阅读全文
posted @ 2013-03-10 21:06 Jojojojoo 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 1.还是建立前面的依赖注入的例子上。2.导入aopalliance.jar aspectjrt.jar aspectjweaver.jar三个包3.新建LogAspect.java,注意此时的方法已经没有annotation(废话)。所以需要在bean.xml做配置package org.zttc.itat.spring.proxy;import org.aspectj.lang.JoinPoint;import org.aspectj.lang.ProceedingJoinPoint;import org.springframework.stereotype.Component;@Comp. 阅读全文
posted @ 2013-03-10 21:05 Jojojojoo 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 1、导入spring的dist中的jar包和commons-logging包2、在src目录下创建相应的beans.xml3、为beans.xml添加相应的schema<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www. 阅读全文
posted @ 2013-03-10 21:04 Jojojojoo 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 1、导入spring的dist中的jar包和commons-logging包2、在src目录下创建相应的beans.xml3、为beans.xml添加相应的schema<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www. 阅读全文
posted @ 2013-03-10 21:03 Jojojojoo 阅读(243) 评论(0) 推荐(0) 编辑