:: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Categories >> Software >> Java Related >> Java J2EE >> Struts


 Core Java interview questions  Core Java Interview Questions (1722)
 Advanced Java interview questions  Advanced Java Interview Questions (331)
 Swing interview questions  Swing Interview Questions (44)
 EJB interview questions  EJB Interview Questions (134)
 Servlets interview questions  Servlets Interview Questions (255)
 Struts interview questions  Struts Interview Questions (196)
 JDBC interview questions  JDBC Interview Questions (187)
 JMS interview questions  JMS Interview Questions (9)
 SunOne interview questions  SunOne Interview Questions (3)
 J2EE interview questions  J2EE Interview Questions (71)
 Weblogic interview questions  Weblogic Interview Questions (147)
 Websphere interview questions  Websphere Interview Questions (14)
 Java Networking interview questions  Java Networking Interview Questions (20)
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions (87)
what is request processor class ?
 Question Submitted By :: Struts
I also faced this Question!!     Answer Posted By  
# 1
Request processor is a class which is under the controller
layer.this class is uesd to acces the client request from
the actionServlet process the req and then dispatches to the
next layer i.e Model(Action class).Finally Action class
calls the execute() and and it return the ActionForward to
Is This Answer Correct ?    30 Yes 9 No
# 2
In struts the Action servlet serves as a front controller
where it receives all the request from the client. All those
requests are delegated to the RequestProcessor class. In
this class process method will be invoked with httprequest
and response objects.
This method has so many method calls to populate the forms,
associating the request to the proper mapping etc.

For more details
Is This Answer Correct ?    12 Yes 5 No
# 3
Class is the actual place where the request processing
takes place in a Struts controller environment.

When the request object first reaches the actionservlet
class then it invokes the process method of the underlying
RequestProcessor Class.

This process method then looks into the struts-config.xml
file and tries to locate the name of the action that has
come with the request.Once it identifies the action in the
xml file it continues the rest of the steps needed for
request processing.

processor has most of the following responsibilities:

1.Determine path,
2.Handle Locale,
3.Process content and encoding type,
4.Process cache headers
5.Pre Processing hook
6.Pre-processing hook,
7.Determine mapping,
8.Determine roles,
9.Process and validate actionForm,
10.Return a response
Is This Answer Correct ?    8 Yes 1 No
# 4
RequestProcessor is an helper class to
Actually ActionServlet is dummy all the work which is done
with the help of RequestProcessor using the method process()

ActionServlet is declarativly defined in web.xml and
RequstProcessor is an predefined class.
we can create our own RequstProcessor class
Is This Answer Correct ?    7 Yes 3 No
# 5
in RequestProcessor we have process()
this process method used to process the enduser request
and it is called by the action servlet doget()or dopost()
method by default it work one way
if u want change the flow of the application before
invoking our action classes we to implent the
requestprocess class
Is This Answer Correct ?    4 Yes 1 No
# 6
1.Request processor class contains th code of form
processing logic. follows the chain of responsibility.
3.action servlet sends the request to the RP.
4.RP binds the values to the form bean by calling setters
and dispath the request to the following according the
a.errors handlers
Is This Answer Correct ?    6 Yes 6 No
# 7
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 ?    0 Yes 0 No
# 8
Whenever client send the request to sever is check is there web. XML file.And the read the contents in web. XML file and store into JVM's memory.
After ur using <load-on-startup> sever is created ActionServlet Object.In second second init()method and the reads the contents stored in JVM's memory.
Now sever is created Request and Response Object's and hadover to ActionServelt Service().
Is This Answer Correct ?    0 Yes 3 No
# 9
Is This Answer Correct ?    1 Yes 4 No
# 10
Is This Answer Correct ?    2 Yes 34 No

Other Struts Interview Questions
  Question Asked @ Answers
What are Struts properties? VI-eTrans 2
If we close the browser,when the specific user session is active.Again if we open browse how to retrive it same user??what code i have to da??? TCS 5
can we change the order of parameters in execute()? Polaris 4
Wat is Difference between Mvc1 architecture and Mvc2 Architecture? HCL 20
what is the advantages and diadvantages of Struts?   1
how to write my own Action servlet by extending pre-defined Action servlet in struts config. Sony 2
what is the use of cvs in struts?   2
how to implement singletun design patteren in struts? HCL 5
why do we typecast ActionForm into our plain java bean class in Action class? What is the reason?   4
What happens when Two users requests for same action class? How the threads are controlled?   4
Please can you tell me ,where can we used the MVC other than web applications.   1
what are java stuts? what are there uses Tech-Mahindra 2
For more Struts Interview Questions Click Here 

Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
Copyright 2013  All Rights Reserved.   ::