jsf+hibernate的问题
lupingzhang
2007-06-10
jsf+hibernate+sqlserver;
jsf页面 <h:dataTable value="#{projectinfo.allprojectinfo}" var="projectinfo"> faces-config.xml中 <managed-bean> <managed-bean-name>projectinfo</managed-bean-name> <managed-bean-class>lab2.ProjectInfoBean</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> </managed-bean> ProjectInfoBean中 public List getAllprojectinfo() throws HibernateException { String queryString = "select * from ProjectInfo as o"; session = sessionFactory.openSession(); transaction = session.beginTransaction(); Query query = session.createQuery(queryString); List result=query.list(); return result; } 运行时 javax.servlet.ServletException: javax.faces.el.EvaluationException: Error getting property 'allprojectinfo' from bean of type lab2.ProjectInfoBean: java.lang.NoClassDefFoundError: javax/transaction/Synchronization org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:864) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800) org.apache.jsp.xiangmuxi_jsp._jspService(xiangmuxi_jsp.java:74) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) ....... 报错,不知道该怎么改? 请大家指点一下. |
|
wangwenpinghello
2007-06-11
'allprojectinfo' 这个list 写get 方法了吗 如过用的是ejb3的话需要在方法上加一个@Factory("allprojectinfo")标记
|