随笔 - 10  文章 - 0  trackbacks - 0
<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用链接

留言簿

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜

转载地址: 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)编辑 收藏

 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)编辑 收藏
ab的全称是ApacheBench,是 Apache 附带的一个小工具,专门用于 HTTP Server 的benchmark testing,可以同时模拟多个并发请求。
下面的方法是在不安装apache的情况下,使用ab工具,
ab执行需要以下依赖,以下的安装文件在Centos安装盘下都可以找的到 
rpm -ivh apr-1.3.9-3.el6.i686.rpm
rpm -ivh apr-util-1.3.9-3.el6_0.1.i686.rpm
httpd-tools-2.2.15-9.el6.centos.i686.rpm
解压缩
rpm2cpio httpd-tools-2.2.15-9.el6.centos.i686.rpm | cpio -idmv
将usr/bin 下面的文件复制 /usr/bin
同理将usr/share下的文件复制到/usr/share下对应目录下
不仅仅是只有ab工具,还有htdbm htdigest htpasswd logresolve工具
posted @ 2012-06-03 12:36 leafcold 阅读(476) | 评论 (0)编辑 收藏
参考文章:http://jarchitect.iteye.com/blog/158776 

问题: 
org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'int-http:inbound-channel-adapter'
真正的原因是缺少了所需要的jar包,将相关的JAR文件引入到Classpath即可
要是把错误信息进一步明确化,提示开发人员 NoClassFoundException异常更直观一点


posted @ 2012-06-02 13:53 leafcold 阅读(245) | 评论 (0)编辑 收藏
引用地址:
http://www.iteye.com/problems/48016


我试过类似$('#win').window('close');


报$.data...options无效的错误,我已经引入了js文件,路径没问题,而且在同一个页面,不用iframe是可以关闭的.

在iframe的页面中,我试图通过调用$(parent.document).find('#win').window('close')方法 去关闭window窗口,但是报js错:$.data...options无效,实在没办法了,还请大家帮忙解决,帮帮在下吧!!!!


解决方法:
parent.$('#win').window('close');


做下记录!
posted @ 2012-05-25 13:00 leafcold| 编辑 收藏
jbpm5和Activiti5的联系与区别

http://www.infoq.com/cn/articles/rh-jbpm5-activiti5


Eclipse插件安装(3.7.2)

http://activiti.org/designer/update/



activiti与mysql集成方法和问题
导入数据库表
sql文件在
activiti-engine-5.9.jar的org/activiti/db/create中

异常错误Caused by: org.activiti.engine.ActivitiException: Activiti database problem: no historyLevel property specified

解决方案

可以将配置文件中
<property name="databaseSchemaUpdate" value="ture" />
也可以

act_ge_property 表中加了historyLevel=2

posted @ 2012-05-12 12:43 leafcold 阅读(1031) | 评论 (0)编辑 收藏
仅列出标题