摘要:
转载:http://www.cnblogs.com/jqyp/archive/2010/08/19/1804032.htmll<s:property>标签用于输出某个OGNL表达式的值,可以认为其内部使用的是ValueStack对象的findString方法。Ø如果没有设置value属性,则输出ValueStack栈顶的对象。Ø特例:如果采用不加#前缀的方式输出Context中的某个对象,这个对象必须是string类型。l<s:push>标签用于将OGNL表达式的值压入栈顶。Ø看<s:push>标签的帮助,可以知道有一个为top 阅读全文
摘要:
转:如何使用HibernateTemplate进行分页功能在使用Hibernate时,可以用query.setFirstResult(130);//设置取值的开始位置query.setMaxResults(10); //设置读取数据的记录条数方便的实现分页。但是Spring 整合 Hibernate 时候用的 HibernateTemplate 却不支持分页,这样当查询记录过多时,就会给我们带来一些麻烦,因此需要自己包装一个类进行分页,具体实现如下:使用spring的hibernateTemplate的回调机制扩展hibernateTemplate的功能实现分页。其中HibernateCall 阅读全文
摘要:
org.springframework.orm.hibernate3.HibernateSystemException: a different object with the same identifier value was already associated with the session: [com.demo.bean.Option]因为在hibernate中同一个session里面有了两个相 同标识但是是不同实体,当这时运行saveOrUpdate(object)操作的时候就会报这个错误。解决方法是:hibernate3.0以上使用merge()来合并两个session中的同一对 阅读全文