hibernate查詢結果Logic:iterate問題
=========================Bzqj.java==============================
package strutshibernate;
import java.io.*;
public class Bzqj {
private String jgbh;
private int bh;
private String mc;
private int bz;
public Bzqj(){}
public String getJgbh() {
return jgbh;
}
public void setJgbh(String jgbh) {
this.jgbh = jgbh;
}
public int getBh() {
return bh;
}
public void setBh(int bh) {
this.bh = bh;
}
public String getMc() {
return mc;
}
public void setMc(String mc) {
this.mc = mc;
}
public int getBz() {
return bz;
}
public void setBz(int bz) {
this.bz = bz;
}
}
====================DBAction.java部分=========================
Configuration cfg = new Configuration().addClass(Bzqj.class);
SessionFactory sessions = cfg.buildSessionFactory();
Session s = sessions.openSession();
Query q = s.createQuery("from Bzqj");
List result = q.list();
httpServletRequest.setAttribute("resultlist", result);
s.close();
System.out.println("##result"+result);
return (actionMapping.findForward("list")); }
===================list.jsp==========================
<%@ page language="java" %>
<%@ page import="java.util.*"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ page contentType="text/html; charset=GBK" %>
<html:html locale="true">
<head>
<title>
list
</title>
</head>
<body bgcolor="ffffff">
<table>
<logic:iterate id="a" name="resultlist" scope="request" property="strutshibernate.Bzqj" >
<tr>
<td>JGBH:<bean:write name="a" property="jgbh" filter="true"/></td>
</tr>
</logic:iterate>
</table>
</body>
</html:html>
=====================老是報錯=====================
org.apache.jasper.JasperException: No getter method for property strutshibernate.Bzqj of bean resultlist
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
....
=========
快瘋了,幫忙啊~~
package strutshibernate;
import java.io.*;
public class Bzqj {
private String jgbh;
private int bh;
private String mc;
private int bz;
public Bzqj(){}
public String getJgbh() {
return jgbh;
}
public void setJgbh(String jgbh) {
this.jgbh = jgbh;
}
public int getBh() {
return bh;
}
public void setBh(int bh) {
this.bh = bh;
}
public String getMc() {
return mc;
}
public void setMc(String mc) {
this.mc = mc;
}
public int getBz() {
return bz;
}
public void setBz(int bz) {
this.bz = bz;
}
}
====================DBAction.java部分=========================
Configuration cfg = new Configuration().addClass(Bzqj.class);
SessionFactory sessions = cfg.buildSessionFactory();
Session s = sessions.openSession();
Query q = s.createQuery("from Bzqj");
List result = q.list();
httpServletRequest.setAttribute("resultlist", result);
s.close();
System.out.println("##result"+result);
return (actionMapping.findForward("list")); }
===================list.jsp==========================
<%@ page language="java" %>
<%@ page import="java.util.*"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ page contentType="text/html; charset=GBK" %>
<html:html locale="true">
<head>
<title>
list
</title>
</head>
<body bgcolor="ffffff">
<table>
<logic:iterate id="a" name="resultlist" scope="request" property="strutshibernate.Bzqj" >
<tr>
<td>JGBH:<bean:write name="a" property="jgbh" filter="true"/></td>
</tr>
</logic:iterate>
</table>
</body>
</html:html>
=====================老是報錯=====================
org.apache.jasper.JasperException: No getter method for property strutshibernate.Bzqj of bean resultlist
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
....
=========
快瘋了,幫忙啊~~
相關文章
- Hibernate 查詢
- VS2015 查詢結果明細沒顯示問題
- mysql查詢結果多列拼接查詢MySql
- hibernate中hql查詢
- Hibernate查詢自動更新
- SpringBoot分頁查詢 頁碼問題導致返回結果數量為0Spring Boot
- hibernate查詢的方式 都有哪些
- hibernate的三種查詢方式
- ps aux查詢結果解釋UX
- Mybatis模糊查詢結果為空MyBatis
- [20190306]奇怪的查詢結果.txt
- MySQL查詢結果匯出方式總結MySql
- Mybatis 查詢語句結果集總結MyBatis
- Hibernate-ORM:13.Hibernate中的連線查詢ORM
- 391、Java框架46 -【Hibernate - 查詢HQL、查詢Criteria、查詢標準SQL】 2020.10.19Java框架SQL
- sql 模糊查詢問題SQL
- ORDER對查詢結果進行排序排序
- Hibernate【查詢、連線池、逆向工程】
- ES查詢之查詢屬性過濾、結果高亮顯示
- 備忘:laravel 對查詢結果集可以迴圈where查詢Laravel
- leetcode題解(查詢表問題)LeetCode
- DBeaver 匯出多個查詢結果集
- PostgreSQL函式:返回表查詢結果集SQL函式
- PLSQL Developer 複製查詢結果 卡頓SQLDeveloper
- Hibernate5.1+Sqlserver2000分頁查詢SQLServer
- hibernate異常之--count查詢異常
- sphinx查詢過濾問題
- Laravel5.7 查詢問題Laravel
- C# dataGridView展示資料庫查詢結果C#View資料庫
- sqlserver查詢結果中新增自動編號SQLServer
- MySQL 查詢結果取交集的實現方法MySql
- 如何使用Hibernate/JPA的JPQL/HQL查詢提取?
- hibernate中的no session問題Session
- SQLAlchemy in 查詢空列表問題分析SQL
- 極兔快遞怎麼查詢物流資訊 支援匯出查詢結果嗎?
- 【記錄】sqlserver列轉行查詢 並將查詢結果用逗號分隔開SQLServer
- 如何分頁顯示資料庫查詢結果?資料庫
- 如何啟用Hibernate慢查詢日誌? -Vlad Mihalcea
- SQL Server 查詢超時問題排查SQLServer