- 博客(10)
- 资源 (1)
- 收藏
- 关注
JSONValidationInterceptor的一个bug, 返回的json数据竟然被注释了
/* { "fieldErrors": {"password":["密码长度为3-20字符"]}} */上面就是校验出错时JSONValidationInterceptor返回给我的结果,竟然被/* {} */包围。这样产生的问题是:使用JQuery这样的ajax框架时,如果设置了返回数据类型dataType=json, jQuery会自动解析返回的字符串成为json对象,倒霉的是,非良...
2011-05-02 20:42:06
245
原创 Spring 3.0 新特性
一、首先,模块的组织更加的细致,从那么多的jar分包就看的出来: Spring的构建系统以及依赖管理使用的是Apache Ivy,从源码包看出,也使用了Maven。 Maven确实是个好东西,好处不再多言,以后希望能进一步用好它。 二、新特性如下: Spring Expression Language (Spring表...
2010-11-05 21:30:43
167
原创 hibernate继承实现的三种策略
继承实现有三种策略:单表继承。每棵类继承树使用一个表(table per class hierarchy) 具体表继承。每个子类一个表(table per subclass) 类表继承。每个具体类一个表(table per concrete class)(有一些限制)1. 因为类继承树肯定是对应多个类,要把多个类的信息存放在一张表中,必须有某种机制来区分哪些记录...
2010-11-04 16:22:38
158
原创 Hibernate优化查询性能的一般手段
Hibernate主要从以下几方面来优化查询性能:1.降低访问数据库的频率,减少select语句的数目。实现手段包括:(1) 使用迫切左外连接或迫切内连接检索策略。(2) 对延迟检索或立即检索策略设置批量检索数目。(3) 使用查询缓存。2.避免多余加载程序不需要访问的数据。实现手段包括:(1) 使用延迟检索策略(2) 使用集合过滤。3.避免报表查询数据占...
2010-11-04 16:14:59
148
原创 Restore My Active Desktop 失败
系统因为掉电重启后出现讨厌的Restore my Active Desktop. 点击以后竟然报错。Error:Object not support this action.Google一番找到了答案!If you have installed IE7 you are guaranteed to get a script error for this action.The normal...
2010-02-09 13:20:57
264
原创 Struts2: Redirect Action Result Bug
该Bug的异常栈如下:Unable to set parameter [id] in result of type [org.apache.struts2.dispatcher.ServletActionRedirectResult] ==> com.opensymphony.xwork2.util.logging.commons.CommonsLogger.error(CommonsL...
2010-01-19 10:58:08
290
原创 Struts2: Spring Plugin
在使用struts2开发Action的时候遇到一个问题,注解@Autowired不起作用,导致出现NullPointerException。这说明了Action实例并不是由spring来创建的(由struts2的objectFactory创建)。那么有什么办法可以将Action Bean交给Spring来管理吗?这时struts2的spring plugin就派上用场了。Spring plug...
2010-01-14 10:32:54
331
原创 HibernateException: No Hibernate Session bound to thread
异常栈:org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here at org.springframework.orm.hibernate3.SpringSess...
2010-01-13 13:38:55
146
原创 Hibernate: could not initialize proxy - no Session
org.hibernate.LazyInitializationException: could not initialize proxy - no Session at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:132) at org.hibernate.prox...
2010-01-12 20:03:43
124
原创 maven中log4j1.2.15的依赖管理
在maven中直接注入对log4j1.2.15的依赖是有问题的,如下:01/04/2010 1:17:15 PM EDT: Missing indirectly referenced artifact javax.jms:jms:jar:1.1:test01/04/2010 1:17:15 PM EDT: Missing indirectly referenced artifact com...
2010-01-11 10:06:20
2838
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人