ITeye博客

spring

共 10 篇文章

spirng 事务处理 aop

<?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:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework…

2014-07-04 16:39 · spring

spirng服务项目启动

public static void main(String[] args) { // TODO Auto-generated method stub //System.setProperty("LogDir", "E:/froad-Points/logs/"); System.setProperty("LogDir", "c:/var/log/applogs/froad-points/"); ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext( "classpath*:…

2014-01-14 16:53 · spring

动态创建定时任务

import java.text.ParseException; import org.quartz.CronTrigger; import org.quartz.Job; import org.quartz.JobDetail; import org.quartz.Scheduler; import org.quartz.SchedulerException; import org.quartz.SchedulerFactory; import org.quartz.Trigger; import org.quartz.impl.StdSchedulerFactory; /** * <pr…

2013-12-12 10:34 · spring

Spring事务配置的五种模式

[转]Spring事务配置的五种方式 前段时间对Spring的事务配置做了比较深入的研究,在此之间对Spring的事务配置虽说也配置过,但是一直没有一个清楚的认识。通过这次的学习发觉Spring的事务配置只要把思路理清,还是比较好掌握的。 总结如下: Spring配置文件中关于事务配置总是由三个组成部分,分别是DataSource、TransactionManager和代理机制这三部分,无论哪种配置方式,一般变化的只是代理机制这部分。 DataSource、TransactionManager这两部分只是会根据数据访问方式有所变化,比如使用Hibernate进行数据访问 时,DataSour…

2013-12-12 10:23 · spring

spring使用总结

<!--[if gte mso 9]><xml><w:WordDocument><w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel><w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery><w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery><w:DocumentKind>DocumentNotSpecified</w:DocumentKind…

2013-06-20 16:46 · spring

spring事务管理

/*2011年8月28日 10:03:30 by Rush */ 环境配置 项目使用SSH架构,现在要添加Spring事务管理功能,针对当前环境,只需要添加Spring 2.0 AOP类库即可。添加方法: 点击项目右键->Build Path->Add librarys: 打开Add Libraries对话框,然后选定 MyEclipse Libraries: 点击Next,找到Spring 2.0 aop Libraries并勾选上,点击finsh即可。 如果在项目里面能看到下面的库文件,说明已经安装成功。 事务配置 首先在/WEB-INF/applicationContext.xml添加…

2013-04-02 11:17 · spring

在filter 中注入bean

<filter> <filter-name>DelegatingFilterProxy</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> <init-param> <param-name>targetBeanName</param-name> <param-value>responseJsonFilter</param-value> </init-param> </filter> <filter-mapping> <filter-name>Delega…

2012-10-22 17:55 · spring

spirng 事务

事务传播 1、required:方法在一个事务中执行,如果调用的方法在一个事务中,则使用该事务,否则将创建一个新的事务。(必须有,有就用,没有就建) 2、mandatory:如果运行于事务中的客户调用了该方法,方法在客户的事务中执行。如果客户没有关联到事务中,容器就会抛出TransactionRequiredException.(必须有,有就用,没有报错) 3、requiresnew:方法将在一个新的事务中执行,如果调用的方法已经在一个事务中,则暂停旧的事务。在调用结束后恢复旧的事务。(必须有,有没有都要建) 4、supports:如果方法在一个事务中被调用,则使用该事务,否则不使用事务。(…

2012-06-04 17:34 · spring

spring 根据名字跳转

<bean id="gotosmyuyue" class="org.springframework.web.servlet.mvc.ParameterizableViewController"> <property name="viewName" value="ftl/smyuyue" /> </bean>

2012-05-25 13:17 · spring · springframework

使用拦截器

23.4 使用拦截器 和Struts2一样,Spring MVC也可以使用拦截器对请求进行拦截处理,用户可以自定义拦截器来实现特定的功能,自定义的拦截器必须实现HandlerInterceptor接口。 【示例23-9】HandlerInterceptor接口的代码如下: package org.springframework.web.servlet; import Javax.servlet.http.HttpServletRequest; import Javax.servlet.http.HttpServletResponse; public interface HandlerInte…

2012-05-15 20:10 · spring