Java Server And Servlet - Study Mode
[#1] What is the role of the `init()` method in Java Servlets?
Correct Answer
(C) To initialize the servlet
[#2] Which of the following is true about servlet containers (e.g., Tomcat)?
Correct Answer
(D) They manage the lifecycle of servlets
[#3] What does the term "URL mapping" refer to in Java Servlets?
Correct Answer
(A) Associating a URL pattern with a servlet
[#4] Which of the following is NOT a standard HTTP status code in Java Servlets?
Correct Answer
(D) `404 Not Found`
[#5] What is the purpose of the `web.xml` ` ` element in a Java web application?
Correct Answer
(C) To map a URL pattern to a servlet
(G) To define a filter that can be applied to servlet requests and responses