ALLInterview.com :: Home Page KalAajKal.com
 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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Java J2EE  >>  Java Related  >>  Servlets
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
what is the control flow in servlet when we send a request?
 Question Submitted By :: Dipak.cvrca
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what is the control flow in servlet when we send a request?
Answer
# 1
-->first request comes from client browser to server 
  (container)which takes the control to the web.xml file.

-->in xml file servlet file(.class) will be searched
   according to the information about the url pattern given
   in the address,then coresponding class file is loaded to
   the container(loading) by the method
   java.lang.class.forName().newInstance.

-->now container call the init(servletConfig) method to add
   necessary headers in the servlet,such as Config,context
   session,request and many more.

-->now control pass to the service()of the HttpServlet(if   
   you have extended this class) and the type of method 
   (get/post) is checked and accordingly the control will
   pass to the implemented doGet() or doPost() of the your
   class(by the dynamic method dispatch)

-->after service the container will call the destroy() of
   Servlet class.
          i hope this answer will satishfy you,thank
          you,Dipu(Deepak ku. jenamani)
 
Is This Answer Correct ?    10 Yes 0 No
Dipak.cvrca
 
  Re: what is the control flow in servlet when we send a request?
Answer
# 2
when we are requesting a particular resource in the
server,the comiled class will be loaded into the container
calls the no-arg constructor and init() then the container
will create request,response objects and pass it to the
corresponding doXXX() method based on the http method of the
form,allocates a thread and do the business logic and send
the response back to the client by sending the thread to a
connection pool and destroying the request and response objects
 
Is This Answer Correct ?    3 Yes 0 No
Ravikiran
 
 
 
  Re: what is the control flow in servlet when we send a request?
Answer
# 3
when we are requesting a particular resource in the
server,the comiled class will be loaded into the container
calls the no-arg constructor and init() then the container
will create request,response objects and pass it to the
corresponding doXXX() method based on the http method of the
form,allocates a thread and do the business logic and send
the response back to the client by sending the thread to a
connection pool and destroying the request and response objects
 
Is This Answer Correct ?    0 Yes 0 No
Ravikiran
 

 
 
 
Other Servlets Interview Questions
 
  Question Asked @ Answers
 
what are binding listners?  1
Name the webserver that is used to run Servlets?  5
when will cookie information destroy?  4
What is difference between Forward() and sendRedirect() methode?  9
What is context switching?  3
Is it possible to call servlet with parameters in the URL?  3
hi.... i have problem in running of servlet. i am using Tomcat server in my pc.. The problem is when i am click on strat it will display like below FAIL - Application at context path /first could not be started.. How i can slove the problem.. help plz  2
how to use servlets with j2ee ? Tech-Mahindra2
What type of protocols are used in HttpServlet?  1
Difference between web container & web server........... Difference between web server & application server????????? TCS6
If we disable cookies in our web page, what will happen? Zensar6
In howmany ways applet-servlet communication can be done?  1
how can you give alias to servlets?  1
waht is the main diference b/w servelts and JSP ? HCL5
What are cookies and how will you use them?  2
What are the exceptions thrown by Servlets? Amplify-Mindware3
What advantages do servlets have over CGI programs?  4
when you comppile the servlet is it neccesary to restaet the tomcat server? HCL6
What is servlet? Siemens13
How to deal with multi-valued parameters in a servlet?  2
 
For more Servlets Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com