if hibernate is user in your project ,it must have a beans which mapping to the ,hbm.xml file
in the struts ActionForm file we can import the beans file ,getter and setted method is nessary
,then we can use these attributes in the page
example
test beans have a attribute named testValue
TestActionForm.java
private Test test;
public Test getTest(){return this.test;}
public void setTest(Test t){test=t;}
test.jsp
<html:text property="test.testValue"/>
that's ok!
in the struts ActionForm file we can import the beans file ,getter and setted method is nessary
,then we can use these attributes in the page
example
test beans have a attribute named testValue
TestActionForm.java
private Test test;
public Test getTest(){return this.test;}
public void setTest(Test t){test=t;}
test.jsp
<html:text property="test.testValue"/>
that's ok!
本文介绍如何在Struts项目中集成Hibernate框架,通过创建映射文件hbm.xml及对应的Beans来实现数据持久化操作。展示了如何在ActionForm中使用这些Beans,并在页面上显示属性。
1万+

被折叠的 条评论
为什么被折叠?



