标签:line 其他 创建 classpath 模块 2.0 bean hiberna mvc
ioc 和aop是spring的核心
spring整合其他技术,例如jdbc,mybtis,hibernate,struts等。
spring ioc应用
a。管理对象
创建,初始化,释放资源,销毁
b。维护对象关系
c。搭建SpringIOC开发环境,引入jar包,在src添加applicationContext.xml
spring模块需要的jar包:
ioc:commons-logging,spring-beans,spring-context,spring-core,spring-expression
aop:
dao:
dbcp:
json:
webmvc:
例子:
java代码:
ApplicationContext ac=new ClassPathXmlApplicationContext("applicationContext.xml");
Calendar c1=ac.getBean("c1",Calendar.class);
System.out.println(c1);
applicationContext.xml:
<bean id="c1" class="java.util.GregorianCalendar"></bean>
标签:line 其他 创建 classpath 模块 2.0 bean hiberna mvc
原文地址:http://www.cnblogs.com/alexhjl/p/6810446.html