Understanding the Life Cycle of an ActionForm

In this chapter, We will discuss the lifecycle of an ActionForm. ActionForm class maintain the session state of web application.
 ActionForm sits between the View and Controller.ActionForm play the role of transfer object between the presentation layer and  Business  layer.

Life Cycle of an ActionForm:-
1. Request is submitted.The ActionServlet controller matches the URI for the request against the path of an action-mapping.
2. Create or recycle ActionForm
3. The ActionServlet then calls reset() on the new or pre-existing ActionForm from the request.\
4. You can store ActionForm in desired scope
5. When passing ActionForm beans between Actions.It is important to populate ActionForm from Request. If you modify a value, you must be sure to protect it from auto populate or reset.
6. if Validate is set to true,the ActionServlet call the validate method.
7. This return any errors message.then forward back to input attribute page actionForm in scope.If no errors found then call execute() with the ActionForm.
8.  Forward to success 

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More