struts and hibernate can use a common beans

来源:互联网 发布:照片转绘画软件 编辑:程序博客网 时间:2024/04/28 15:08
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!
原创粉丝点击