SpringMVC
第一个简单案例:
1) 建一个Web工程
2) 在web.xml中配置
servlet>
servlet-name>springMVCservlet-name>
servlet-class>org.springframework.web.servlet.DispatcherServletservlet-class>
load...
分类:
编程语言 时间:
2014-09-24 09:40:16
阅读次数:
211
最终得出结果:先 listener >> filter >> servlet >> spring所以,如果过滤器中要使用到 bean,可以将spring 的加载 改成 Listener的方式org.springframework.web.context.ContextLoaderListener参考...
分类:
Web程序 时间:
2014-09-23 21:27:55
阅读次数:
221
由于HibernateTemplate的原理与JdbcTemplate的原理类似,现在先讨论JdbcTemplate,在使用JDBC的时候,总是要处理繁琐的细节,例如Connection、statement的获得,SQLException的处理,Connection、Statement的关闭等问题。使用Spring提供的org.springframework.jdbc.core.JdbcTe..
分类:
系统相关 时间:
2014-09-23 21:25:25
阅读次数:
303
整合了一下springmvc +hibernate4.希望对你们有点帮助,希望能多技术交流,需要源码请留下邮箱地址
目录结构图
注意是我的项目是在utf-8,jdk7下
相关配置
pom.xml
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:mvc="http://www.springframe...
分类:
编程语言 时间:
2014-09-23 21:23:35
阅读次数:
366
org.springframework.beans.factory.BeanFactory是Spring IoC容器的实际代表者,IoC容器负责容纳此前所描述的bean,并对bean进行管理。在Spring中,BeanFactory是IoC容器的核心接口。 它的职责包括:实例化、定位、配置应用程序中...
分类:
移动开发 时间:
2014-09-23 02:18:13
阅读次数:
230
log4j:WARN No appenders could be found for logger(org.springframework.context.support.ClassPathXmlApplicationContext).log4j:WARN Please initialize the...
分类:
其他好文 时间:
2014-09-22 22:09:23
阅读次数:
228
通过注解配置BeanTestObject.javapackagecom.spring.beans.annotation;
importorg.springframework.stereotype.Component;;
@Component
publicclassTestObject{
}UserController.javapackagecom.spring.beans.annotation.controller;
importorg.springframework.stereotype...
分类:
编程语言 时间:
2014-09-22 20:43:23
阅读次数:
268
一个定时执行的job package dk.spring.quartz;
import java.util.Date;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.Qua...
分类:
编程语言 时间:
2014-09-21 18:32:31
阅读次数:
279
子模块中配置Spring依赖 org.springframework spring-beans ${org.springframework.version} ...
分类:
编程语言 时间:
2014-09-20 17:25:39
阅读次数:
234
当session中出现两个相同标示的(相同主键)的对象,一个是持久态,一个是瞬时态,想更新瞬时态对象到数据库,如果不做处理,则报出异常,session中出现两个相同标示的不同对象异常。处理方法。(业务层代码,省去了dao层)一:通过hibernateTemplate获取映射seession(模拟) ...
分类:
编程语言 时间:
2014-09-19 20:51:56
阅读次数:
315