Top 50+ Solved Servlet and Overview MCQ Questions Answer

From 1 to 15 of 32

Q. How is the dynamic interception of requests and responses to transform the informationdone?

a. servlet container

b. servlet config

c. servlet context

d. servlet filter

  • d. servlet filter

Q. Which type of ServletEngine is a server that includes built-in support for servlets?

a. Add-on ServletEngin

b. Embedded ServletEngine

c. Standalone ServletEngine

d. None of the above

  • c. Standalone ServletEngine

Q. Which cookie it is valid for single session only and it is removed each time when the usercloses the browser?

a. Persistent cookie

b. Non-persistent cookie

c. All the above

d. None of the above

  • b. Non-persistent cookie

Q. When destroy() method of a filter is called?

a. The destroy() method is called only once at the end of the life cycle of a filter

b. The destroy() method is called after the filter has executed doFilter method

c. The destroy() method is called only once at the begining of the life cycle of a filter

d. The destroyer() method is called after the filter has executed

  • a. The destroy() method is called only once at the end of the life cycle of a filter

Q. Web server is used for loading the init() method of servlet.

a. True

b. False

c. none

d. all

  • a. True

Q. Servlets handle multiple simultaneous requests by using threads.

a. True

b. False

c. none

d. all

  • a. True

Q. Which method is used to send the same request and response objects to another servlet inRequestDispacher ?

a. forward()

b. sendRedirect()

c. Both A & B

d. None of the above

  • a. forward()

Q. Which packages represent interfaces and classes for servlet API?

a. javax.servlet

b. javax.servlet.http

c. Both A & B

d. None of the above

  • c. Both A & B

Q. Which class can handle any type of request so that it is protocol-independent?

a. GenericServlet

b. HttpServle

c. Both A & B

d. None of the above

  • a. GenericServlet

Q. Which HTTP Request method is non-idempotent?

a. GET

b. POST

c. Both A & B

d. None of the above

  • c. Both A & B

Q. Which object is created by the web container at time of deploying the project?

a. ServletConfig

b. ServletContext

c. Both A & B

d. None of the above

  • b. ServletContext

Q. What is the lifecycle of a servlet?

a. Servlet class is loaded

b. Servlet instance is created

c. init,Service,destroy method is invoked

d. All mentioned above

  • d. All mentioned above
Subscribe Now

Get All Updates & News