Top 50+ Solved Servlet and Overview MCQ Questions Answer

From 16 to 30 of 32

Q. Which are the examples of Application Server?

a. Apache

b. Tomcat

c. JBoss

d. Weblogic

  • c. JBoss

Q. In the following statements identify the disadvantages of CGI?

a. If number of clients increases, it takes more time for sending response

b. For each request, it starts a process and Web server is limited to start processes

c. It uses platform dependent language e.g. C, C++, perl

d. All mentioned above

  • d. All mentioned above

Q. Servlet technology is used to create web application

a. True

b. False

c. none

d. all

  • a. True

Q. Which method is used to specify before any lines that uses the PintWriter?

a. setPageType()

b. setContextType()

c. setContentType()

d. setResponseType()

  • c. setContentType()

Q. What are functions of Servlet container?

a. Lifecycle management

b. Communication Support

c. Multithreading Support

d. All of the above

  • d. All of the above

Q. Which object of HttpSession can be used to view and manipulate information about asession?

a. session identifier

b. creation time

c. last accessed time

d. All mentioned above

  • d. All mentioned above

Q. Which methods are used to bind the objects on HttpSession instance and get the objects?

a. setAttribute

b. getAttribute

c. Both A & B

d. None of the above

  • c. Both A & B

Q. Which method take a string not a URL?

a. sendRedirect

b. forward

c. Both

d. None

  • a. sendRedirect

Q. The life cycle of a servlet is managed by

a. servlet context

b. servlet container

c. the supporting protocol (such as http or https)

d. All of the above

  • b. servlet container

Q. Which of the following code is used to get an attribute in a HTTP Session object inservlets?

a. session.getAttribute(String name)

b. session.alterAttribute(String name)

c. session.updateAttribute(String name)

d. session.setAttribute(String name)

  • a. session.getAttribute(String name)
Subscribe Now

Get All Updates & News