ITeye博客

Spring

共 3 篇文章

spring @Transactional(一)

Spring事务的传播行为 在service类前加上@Transactional,声明这个service所有方法需要事务管理。每一个业务方法开始时都会打开一个事务。 Spring默认情况下会对运行期例外(RunTimeException)进行事务回滚。这个例外是unchecked 如果遇到checked意外就不回滚。 如何改变默认规则: 1 让checked例外也回滚:在整个方法前加上 @Transactional(rollbackFor=Exception.class) 2 让unchecked例外不回滚: @Transactional(notRollbackFor=RunTimeExce…

2012-06-07 10:30 · Spring

<mvc:annotation-driven/> <context:annotation-config/> <context:component-scan/

< mv c:annotation-driven/> 相当于注册了DefaultAnnotationHandlerMap ping 和AnnotationMethodHandlerAdapter两个bean,配置一些messageconverter。即解决了@Con tr oller注解的使用前提配置。 <cont ex t:annotation-config/> 1)隐式地向Spring容器中注册AutowiredAnnotationBeanPostProcessor、CommonAnnotationBeanPostProcessor、Persiste nc eAnnotationBean…

2012-05-11 17:12 · Spring

Kaptcha 属性

Constant Description Default kaptcha.border Border around kaptcha. Legal values are yes or no.(设置是否有边框 ) yes kaptcha.border.color Color of the border. Legal values are r,g,b (and optional alpha) or white,black,blue.(设置边框颜色) black (105,179,90) kaptcha.border.thickness Thickness of the border around …

2011-12-13 19:10 · Spring