共 29 篇文章 |
|
SpringMVC之类型转换Converter。ConverterRegistry接口的定义如下:Java代码 public interface ConverterRegistry { void addConverter(Converter<?, ?> converter); void addConverter(GenericConverter converter); void addConverterFactory(ConverterFactory<?, ?> converterFactory); voi... 阅416 转1 评0 公众公开 17-04-10 15:40 |
Spring MVC 4之ViewResolver视图解析器。Spring中的视图由视图解析器处理这个逻辑视图名称,Spring有以下几种视图解析器:如果视图解析器没有指定视图的话,Spring就会检查其它的视图解析器,直到有一个完整的包含视图的视图解析器。总结:本文介绍了Spring MVC 4中常见的几种视图解析器,以及如何配置视图解析器包括链式视图解析器,最后除了... 阅79 转0 评0 公众公开 17-04-07 00:15 |
l 资源管理2.1、集成Hibernate方式:[hibernate4为例]HibernateTransactionManager通过将事务管理的职责委托给org.hibernate.Transaction对象,org.hibernate.Transaction对象从Hibernate Session中获取,然后由Transaction对象来提交、回滚事务。【tips】如果使用Hibernate,将事务声明为只读会导致flush模式被设置为FLUSH_NEVER,这会告诉hi... 阅93 转1 评0 公众公开 17-04-04 22:19 |
Spring MVC之@RequestBody, @ResponseBody 详解引言:* @param contentType the content type to use when writing. May be {@code null} to indicate that the * default content type of the converter must be used. If not {@code null}, this media type must have * previously been passed to the {@link #canWrite canWrite}... 阅1 转自山顶的血 公众公开 17-03-28 07:11 |
Spring <context:annotation-config />配置详解 阅244 转0 评0 公众公开 15-09-20 12:09 |
<aop:aspectJ-autoproxy />通过aop命名空间的<aop:aspectj-autoproxy />声明自动为spring容器中那些配置@aspectJ切面的bean创建代理,织入切面。<aop:aspectj-autoproxy />有一个proxy-target-class属性,默认为false,表示使用jdk动态代理织入增强,当配为<aop:aspectj-autoproxy poxy-target-class="true"... 阅243 转0 评0 公众公开 15-09-20 11:20 |
当前方法调用使用的缓存列表(如@Cacheable(value={"cache1", "cache2"})),则有两个cache.新增/修改数据时往缓存中写 Java代码 @Caching( put = { @CachePut(value = "user", key = "#user.id"), @CachePut(value = "user", key = "#us... 阅11 转0 评0 公众公开 15-09-17 10:09 |
Spring Cache 介绍Spring Cache.// 查询数据库accountService.getAccount("accountName", "123456", true);// 走缓存accountService.getAccount("accountName", "123456", false);// 走缓存accountService.getAccount("accountName", "654321", true);// 查询数据库accountServic... 阅34 转0 评0 公众公开 15-09-16 18:59 |
提供了LRU、LFU和FIFO缓存淘汰算法,Ehcache 1.2引入了最少使用和先进先出缓存淘汰算法,构成了完整的缓存淘汰算法。Ehcache是第一个引入缓存数据持久化存储的开源Java缓存框架。分布式缓存的选项包括:通过Terracotta的缓存集群:设定和使用Terracotta模式的Ehcache缓存。3、复制式缓存(Replicated Ehcache):缓存数据时同时存放在多个应用... 阅29 转0 评0 公众公开 15-09-16 16:55 |