GoConqr has a new look! Let us know what you think.

Quiz

Servlets

Chris Noctskie 50 questions

Take the quiz

Questions in this quiz (50)

  1. 1What are Servlets?
    1. AJava Servlets are programs that run on a Web or Application server.
    2. BJava Servlets act as a middle layer between a request coming from a Web browser or other HTTP client and databases or applications on the HTTP server.
    3. CBoth of the above.
    4. DNone of the above.
  2. 2Which of the following is true about servlets?
    1. AServlets execute within the address space of a Web server.
    2. BServlets are platform-independent because they are written in Java.
    3. CThe full functionality of the Java class libraries is available to a servlet.
    4. DAll of the above.
  3. 3Which of the following package contains servlet classes?
    1. Ajavax.servlet
    2. Bjavax.servlet.http
    3. CBoth of the above.
    4. DNone of the above.
  4. 4Which of the following is the correct order of servlet life cycle phase methods?
    1. Ainit, service, destroy
    2. Binitialize, service, destroy
    3. Cinit, execute, destroy
    4. Dinit, service, delete
  5. 5When init method of servlet gets called?
    1. AThe init method is called when the servlet is first created.
    2. BThe init method is called whenever the servlet is invoked.
    3. CBoth of the above
    4. DNone of the above.
  6. 6Which of the following is true about init method of servlet?
    1. AThe init method simply creates or loads some data that will be used throughout the life of the servlet.
    2. BThe init method is not called again and again for each user request.
    3. CBoth of the above.
    4. DNone of the above.
  7. 7When service method of servlet gets called?
    1. AThe service method is called when the servlet is first created.
    2. BThe service method is called whenever the servlet is invoked.
    3. CBoth of the above.
    4. DNone of the above.
  8. 8Which of the following is true about service method of servlet?
    1. AThe servlet container i.e.webserver calls the service method to handle requests coming from the client.
    2. BEach time the server receives a request for a servlet, the server spawns a new thread and calls service.
    3. CThe service method checks the HTTP request type GET,POST,PUT,DELETE,etc. and calls doGet, doPost, doPut, doDelete, etc. methods as appropriate.
    4. DAll of the above.
  9. 9When doGet method of servlet gets called?
    1. AA GET request results from a normal request for a URL.
    2. BThe service method checks the HTTP request type as GET and calls doGet method.
    3. CBoth of the above.
    4. DNone of the above.
  10. 10When doPost method of servlet gets called?
    1. AA POST request results from an HTML form that specifically lists POST as the METHOD.
    2. BThe service method checks the HTTP request type as POST and calls doPost method.
    3. CBoth of the above.
    4. DNone of the above.

Information

Description
Quiz on Servlets, created by Chris Noctskie on 26/06/2018.
Language
English
Views
0
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?