struts and hibernate can use a common beans
2006-02-26 22:42
501 查看
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 2 and Hibernate Integration
- what difference between Restrictions and Property in hibernate ?who can tell me?
- 【struts】、【hibernate】 、【Spring】and【AJAX】的小理解
- Why Johnny can't clone: Common pitfalls and not so common solutions
- Create a Dlg's Thread and use it,this can use dlg handle.
- studio 显示 can't use Subversion connand line client
- Can I use a Frameset design and still attract attention from the search engines?
- "Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
- Common Struts Errors and Causes--Struts常见错误
- (Page 1 of 3 )A walking tour of JavaBeans What JavaBeans is, how it works, and why you want to use it
- 解决Can't find common super class of [android/app/Application] (with 4 known super classes) and [com/m
- Can ORACLE use both memory_target and AIX large pages at the same time ?
- How can you decide to use UINavigationBar, UIToolbar and UITabbar
- (Page 2 of 3 )A walking tour of JavaBeans 2 :What JavaBeans is, how it works, and why you want to use it
- How to use Hibernate annotations @ManyToOne and @OneToMany for associations
- aotu modify table ' field's value,by ODBC directly is false,but use CDatabase can well and also the header file is needed.
- (Page 3 of 3 )A walking tour of JavaBeans What JavaBeans is, how it works, and why you want to use it
- [MST] Create Dynamic Types and use Type Composition to Extract Common Functionality
- Can we use function on left side of an expression in C and C++?
- ★ Learn how you can use Adobe Creative Suite to create skins for Flex and AIR applications.