Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Action Forms and Beans

 
Balachandar Nayak
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
:roll:
Im learning J2EE and Im a beginner
What is JavaBean?
What is the use of the getter and setter functions
described in the Bean?
How it is used to transfer data from a GUI and a database?
In case of Struts we are using ActionForm What is its use?
Kindly response to my question.

Thanks in Advance

Regards
bala
 
Rekha
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Javabeans are independent,reusable software modules they extend java's "write once",run any where and "reuse every where" capability.

Each bean has properties,events and methods associated with it.

The set/get methods are used for setting and getting the properties of a Bean.

For a short introduction on Javabeans you can visit

http://java.sun.com/developer/onlineTraining/Beans/JBShortCourse/beans.html#beanIntro

ActionForm:
An ActionForm is a JavaBean that extends org.apache.struts.action.ActionForm. ActionForm maintains the session state for web application and the ActionForm object is automatically populated on the server side with data entered from a form on the client side.

~ Rekha.
 
Aro Rajesh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In Struts, java bean which extends ActionForm acts like a transform object between view (jsp) and action (servlet). so u can directly access the properties defined in jsp. on a return from servlet, it is useful in displaying the values of properties using BEAN or HTML tag of struts.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic