SpringMVC整合ibatis时,写了一个测试方法,运行正常,当运行另一个方法时报找不到对应的路径。此处无法理解,为什么同样规则的请求,第一次能够拦截第二次却提示找不到对应的处理方法。后来将添加的第二个方法逐一注释掉,才发现在Dao层中读取applicationContext.xml时,为了让d...
分类:
移动开发 时间:
2014-07-16 23:18:33
阅读次数:
249
在Spring的applicationContext.xml中配置映射文件的方法: com/almaer/model/Person.hbm.xml com/almaer/model/Car.hbm.xml com/almaer/model/Engine.hbm.xml com/almaer/mod....
分类:
移动开发 时间:
2014-07-07 14:27:59
阅读次数:
279
(1) 导入相关包,包结构如下图所示: (2) 修改src/applicationContext.xml文件,结果如下所示:[java] view plaincopy (3) 在src下添加jdbc.properties[java] view plaincopydriver=com.my...
分类:
编程语言 时间:
2014-07-01 19:45:05
阅读次数:
353
最近在整合Spring和ibatis时,不管applicationContext.xml放在哪儿,在web.xml中怎么配置,tomcat启动时始终报applicationContext.xml的错。后来查资料后才发现之前的web.xml配置文件没有在中指定applicationContext.xm...
分类:
编程语言 时间:
2014-06-27 23:12:44
阅读次数:
353
一直搞不明白两者的区别。 如果使用了SpringMVC,事实上,bean的配置完全可以在xxx-servlet.xml中进行配置。为什么需要applicationContext.xml?一定必须? 一、 因为直接使用了SpringMVC,所以之前一直不明白xxx-servlet.xml和applic...
分类:
移动开发 时间:
2014-06-27 21:20:59
阅读次数:
257
在很多中经常要用到定时任务,quartz是定时器中比较好用的,在Spring中使用quartz是很容易的事情,首先在spring的applicationContext.xml文件中增加如下配置:work10003000 2 -->其中beanstartQuertz是quartz的入口,该...
分类:
编程语言 时间:
2014-06-27 20:22:45
阅读次数:
185
job存在数据库中,可以进行动态的增增删改查,最近遇到了如何获取ApplicationContext上下文的问题,解决办法如下
applicationContext-quartz.xml
applicationContextSchedulerContextKey: 是org.springframework.scheduli...
分类:
移动开发 时间:
2014-06-22 18:19:42
阅读次数:
230
singleton
prototype
request
session
global session
后三种只适用于容器为webaware applicationContext 例如XmlWebApplicationContext
当 后三种范围bean 被依赖时候,需要添加 cglib代理
xmlns:xsi="http://www.w...
分类:
编程语言 时间:
2014-06-22 00:24:01
阅读次数:
278
3.1 Spring IoC容器与Beans简介
BeanFactory接口提供对任意对象的配置;
ApplicationContext是BeanFactory的子接口,整合了Spring Aop功能,消息资源控制,事件发布,应用层特殊的上下文(在web应用中)
由IoC容器实例化、组装、管理的对象都是Bean
3.2 容器概述
org.springfra...
分类:
编程语言 时间:
2014-06-21 18:27:01
阅读次数:
264
本文内容来自:《传智播客-OA项目》一,集成 Spring 与 Hibernate 1,配置SessionFactory 1,配置 ---------------------- applicationContext.xml ------------------------ ...
分类:
其他好文 时间:
2014-06-20 20:04:27
阅读次数:
210