JavaBeans and Scope :- Model Components in Struts Frameworks

JavaBeans can be stored a number of different collections of attributes.the rules defining lifetime and visibility are called the scope of those beans.


JavaBeans can be stored a number of different collections of attributes.the rules defining lifetime and visibility are called the scope of those beans.

page - This is used for visible within a single JSP page, for the lifetime of the current request.
request - This is used for visible within a single JSP page, as well as to any page or servlet that is included in this page, or forwarded to by this page. 
session - Thsi are visible to all JSP pages and servlets that participate in a particular user session .This bean handle one or more requests. 
application - This are visible to all JSP pages and servlets that are part of a web application.

ActionForm Beans:- Model Components in Struts Frameworks
ActionForm beans almost similar to the JavaBeans( ModelBeans) but should be consider a Controller component. Because, that able to transfer data between the
Model and View layers.


 In struts framework the ActionForm is generally define by the extending the org.apache.struts.action.ActionForm, Sometime ActionBean also called "form beans". These may be finely-grained objects, so that there is one bean for each form, or coarsely-grained so that one bean serves several forms, or even an entire application.

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More