最新回答 / bochyjinan12
再說了。就給這點截圖。能看出什么來。。你怎么分的包。每個包下的文件截圖都發清楚,倒的什么包都要截圖出來。不能漏??茨鉼serlogin方法上面那個注解。我就知道。你壓根就沒好好聽。老師的代碼里帶了么?真是的。
2016-02-26
提示:hbernate 4.1之后對于HQL中查詢參數的占位符做了改進。
改進前代碼:
String hql = "select t from Blog t where t.site=?";
query.setParameter(0, "micmiu.com");
改進后代碼:
String hql2 = "select t from Blog t where t.site=:site";
query2.setParameter("site", "micmiu.com");
改進前代碼:
String hql = "select t from Blog t where t.site=?";
query.setParameter(0, "micmiu.com");
改進后代碼:
String hql2 = "select t from Blog t where t.site=:site";
query2.setParameter("site", "micmiu.com");
2016-02-26
已采納回答 / war3
可能是你Struts.xml文件中的關于StudentsAction中的返回Students_query_success的方法的result標簽沒配置或者配置錯誤
2016-02-22
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
還有<property name="connection.password">zxcvbn</property>這一欄填好自己數據庫的密碼比如我的數據庫密碼為zxcvbn
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
還有<property name="connection.password">zxcvbn</property>這一欄填好自己數據庫的密碼比如我的數據庫密碼為zxcvbn
弄了一下午才把測試的表在數據庫里生成,為了幫助一些還有錯誤的伙伴,我把幾個注意的點說明下:本人用的是MyEclipse,最好還是把包導入到lib里,千萬注意那3個xml文件的頭部。。我前面是手敲的,出了各種問題。。。。。
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
請接著看下面,還有一部分
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
請接著看下面,還有一部分