Q.What is Action Class. What are the methods in Action class?
An Action is an adapter between the contents of an incoming HTTP request and the corresponding business logic that should be executed to process this request. The controller (RequestProcessor) will select an appropriate Action for each request, create an instance (if necessary), and call the execute method. Actions must be programmed in a thread-safe manner, because the controller will share the same instance for multiple simultaneous requests. This means you should design with the following items in mind: Instance and static variables MUST NOT be used to store information related to the state of a particular request. They MAY be used to share global resources across requests for the same action.
Q.What is Action Class? What are the methods in Action class?
Q.What is the use of ActionForm class, Describe it's Life Cycle?
ActionForm class is used to capture user-input data from an HTML form and transfer it to the Action Class. ActionForm plays the role of Transport Vehicle between the presentation Tire & Business Tier.Life Cycle :1. Request received by Controller2. Create or recycle ActionForm3. Call reset()4. store ActionForm in proper scope5. populate ActionForm from Request6. Validate the ActionForm7. If errors found then forward back to input attribute page(configured in Action mapping in struts-config.xml) with ActionForm in scope. If no errors found then call execute() with the ActionForm.
0 comments:
Post a Comment