随笔 - 10  文章 - 0  trackbacks - 0
<2012年6月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

常用链接

留言簿

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜

转载地址: http://zwllxs.iteye.com/blog/1070429 
   
在一次做非常复杂的ajax应用时,如果一个会话已经超时,但是此时再通过ajax请求,那么ajax返回的则是一个登陆页面的html,那这下就惨了,页面上而已就乱了,那么,能否在java端,如拦截器里判断客户的的请求是否是ajax请求呢,经过查询,能. 
   普通请求与ajax请求的报文头不一样,通过如下 

Java代码  
String requestType = request.getHeader("X-Requested-With");  

如果requestType能拿到值,并且值为XMLHttpRequest,表示客户端的请求为异步请求,那自然是ajax请求了,反之如果为null,则是普通的请求 
posted @ 2012-08-01 16:20 leafcold 阅读(332) | 评论 (0)编辑 收藏
AOP在spring的controller里无效的问题
Controller的AOP需要写在servlet.xml里
posted @ 2012-07-12 17:57 leafcold 阅读(525) | 评论 (0)编辑 收藏
nexus扩展maven库
1、http://repository.jboss.org/nexus/content/groups/public/  为了hibernate
2、https://repository.jboss.org/nexus/content/groups/public-jboss/     主要是birt report
3、http://mirrors.ibiblio.org/pub/mirrors/maven2/  
4、http://maven.springframework.org/release/   spring amqp等
5、https://maven.alfresco.com/nexus/content/groups/public/   activiti
posted @ 2012-07-12 11:10 leafcold 阅读(190) | 评论 (0)编辑 收藏

 hibernate.cache.region.factory_class=net.sf.ehcache.hibernate.EhCacheRegionFactory  

报 ClassNotFoundException: org.hibernate.cache.TimestampsRegion

 hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory  

报 ClassNotFoundException: org.hibernate.cache.ehcache.EhCacheRegionFactory

后来找到原因,   net.sf.ehcache.hibernate.EhCacheRegionFactory  不支持hibernate4

hibernate4支持ehcache的话,需要引入

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
  <version>4.1.2.Final</version>
</dependency>


参考地址:http://forums.terracotta.org/forums/posts/list/6674.page

posted @ 2012-06-27 16:36 leafcold 阅读(1318) | 评论 (0)编辑 收藏