添加此ActionListener时出现错误
我有下面的代码:
当我添加<f:actionListener binding="
它会给出以下错误:
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:114) at com.sun.faces.facelets.tag.jsf.core.ActionListenerHandler$LazyActionListener.processAction(ActionListenerHandler.java:112) at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88) at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
这是我的getTotal函数:
List total = null; try { org.hibernate.Transaction tx = session.beginTransaction(); Query q = session.createQuery("SELECT SUM(amount) from CustomerPayment where DATE like '%"+year+"' GROUP BY type"); total = (List) q.list(); } catch (Exception e) { e.printStackTrace(); } return totalDataTable = new ListDataModel(total);
可能是什么问题?
问题在于actionListener
的binding
属性的值 – 它应该指向一个实现ActionListener
接口的对象 – 而不是你的情况下的方法调用。
来自JSF规范:
值绑定表达式,其值为实现javax.faces.event.ActionListener的对象。
- 在Spring applicationContext.xml中使用P6Spy和数据源
- Hibernate 4未设置’hibernate.dialect’时,对DialectResolutionInfo的访问不能为空
- 如何在spring / hibernate / jpa中创建自动表创建?
- 如何处理复合键hibernate
- 在Hibernate中创建查询
- javax.persistence.PersistenceException:org.hibernate.PersistentObjectException:传递给persist的分离实体
- 如何使用Hibernate调用自定义数据库函数?
- 从数据库加载26MB文本数据消耗了258MB的JVM堆
- hibernate与c3p0:createClob()尚未实现