what is request processor class ?

Answer Posted / rajesh

We say that ActionServlet is the backbone of the struts application but actually it just receives the request and invoke RequestProcessor process() method and this RequestProcessor processes all aspects of the request.
If the above is true , then RequestProcessor should be the heart of struts application or do we consider {ActionServlet + Requestprocessor} as a single unit when we say "ActionServlet is the backbone of the struts application".

1. ActionServlet receives the request.
2. The doPost() or doGet() methods receive a request and invoke the process() method.

3. The process() method gets the current RequestProcessor and invokes the RequestProcessor. process() method

4.The RequestProcessor.process() method is where the current request is actually serviced. This method retrieves, from the struts-config.xml file, the <action> element that matches the path submitted on the request. It does this by matching the path passed in the <html:form /> tag's action element to the <action> element with the same path value

5. When the RequestProcessor.process() method has a matching <action>, it looks for a <form-bean> entry that has a name attribute that matches the <action> element's name attribute.

6. When the RequestProcessor.process() method knows the fully qualified name of the FormBean, it creates or retrieves a pooled instance of the ActionForm named by the <form-bean> element's type attribute and populates its data members with the values submitted on the request

7. After the ActionForm's data members are populated, the RequestProcessor.process() method calls the ActionForm.validate() method, which checks the validity of the submitted values.

8. At this point, the RequestProcessor.process() method knows all that it needs to know and it is time to actually service the request. It does this by retrieving the fully qualified name of the Action class from the <action> element's type attribute, creating or retrieving the named class, and calling the Action.execute() method

9. When the Action class returns from its processing, its execute() method returns an ActionForward object that is used to determine the target of this transaction. The RequestProcessor.process() method resumes control, and the request is then forwarded to the determined target.

10. At this point, the ActionServlet instance has completed its processing for this request and is ready to service future requests.


Most of the controlling work is done by RequestProcessor and still we say ActionServlet is the backbone ?

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the core classes of struts framework? Explain

524


What is used to display the intermediate result in an interceptor?

499


Explain struts.devmode?

563


What do you mean by action errors and what are the results they force?

572


Lists the bundled validators in struts?

551






What applications use apache struts?

493


What does the term struts mean?

553


What is the purpose of '@customvalidator'?

580


What is use of i18n interceptor?

538


What is the purpose of @requiredstringvalidator annotation?

527


What inbuilt themes are provided by struts2?

589


How can we work with error tags?

548


Are struts and shocks the same?

498


What is the difference between struts and spring? Explain

483


How action-mapping tag is used for request forwarding in struts configuration file?

580