๐Ÿงช Servlets MCQ Quiz Hub

Servlets - Java (MCQ) questions

Choose a topic to test your knowledge and improve your Servlets skills

Which object of HttpSession can be used to view and manipulate information about a session?





โœ… Correct Answer: 4

Which class provides stream to read binary data such as image etc. from the request object?





โœ… Correct Answer: 1

Which class provides stream to read binary data such as image etc. from the request object?





โœ… Correct Answer: 1

Which of these ways used to communicate from an applet to servlet?





โœ… Correct Answer: 4

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





โœ… Correct Answer: 3

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





โœ… Correct Answer: 3

What type of servlets use these methods doGet(), doPost(),doHead, doDelete(), doTrace()?





โœ… Correct Answer: 2

Which cookie it is valid for single session only and it is removed each time when the user closes the browser?





โœ… Correct Answer: 2

Which method is used to send the same request and response objects to another servlet in RequestDispacher ?





โœ… Correct Answer: 1

Which packages represent interfaces and classes for servlet API?





โœ… Correct Answer: 3

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





โœ… Correct Answer: 1

Which HTTP Request method is non-idempotent?





โœ… Correct Answer: 2

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





โœ… Correct Answer: 2

What is the lifecycle of a servlet?





โœ… Correct Answer: 4

Which method in session tracking is used in a bit of information that is sent by a web server to a browser and which can later be read back from that browser?





โœ… Correct Answer: 3

In HTTP Request what asks for the loopback of the request message, for testing or for troubleshooting?





โœ… Correct Answer: 4

In HTTP Request what asks for the loopback of the request message, for testing or for troubleshooting?





โœ… Correct Answer: 4

In HTTP Request what asks for the loopback of the request message, for testing or for troubleshooting?





โœ… Correct Answer: 4

In HTTP Request what asks for the loopback of the request message, for testing or for troubleshooting?





โœ… Correct Answer: 4

Which one of the following scopes does the attribute in servlet is an object that can be set, get or removed?





โœ… Correct Answer: 4

Which are the examples of Application Server?





โœ… Correct Answer: 4

How many techniques are used in Session Tracking?





โœ… Correct Answer: 1

In the following statements identify the disadvantages of CGI?





โœ… Correct Answer: 4

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





โœ… Correct Answer: 3

What are the functions of Servlet container?





โœ… Correct Answer: 4

What are the functions of Servlet container?





โœ… Correct Answer: 4

. What is bytecode?





โœ… Correct Answer: 3

Which of the following statements are correct about the status of the Http response.





โœ… Correct Answer: 3

Which JDBC driver Type(s) can be used in either applet or servlet code?





โœ… Correct Answer: 3

Which of the following code retrieves the MIME type of the body of the request?





โœ… Correct Answer: 2

To send text output in a response, the following method of HttpServletResponse may be used to get the appropriate Writer/Stream object.





โœ… Correct Answer: 3

Which method take a string not a URL?





โœ… Correct Answer: 1

RequestDispatcher object is used





โœ… Correct Answer: 1

Which of the following are interface? 1. ServletContext 2. Servlet 3. GenericServlet 4. HttpServlet





โœ… Correct Answer: 2

What is the meaning of response.setHeader("xyz", "abc





โœ… Correct Answer: 1

How many JDBC driver types does Sun define? One





โœ… Correct Answer: 3

What are the features added in Servlet 2.5?





โœ… Correct Answer: 4

The life cycle of a servlet is managed by





โœ… Correct Answer: 2

Which of the following method sets application/context init parameter?





โœ… Correct Answer: 3

Which method shows the client what server is receiving?





โœ… Correct Answer: 1