1. What is a servlet in Java? A. A Java program that runs on the server to handle client requests B. A type of coffee bean C. A Java class used for file I/O D. A Java keyword Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
2. Which of the following is a valid method in the `HttpServlet` class in Java? A. `handleRequest()` B. `runServlet()` C. `execute()` D. `doGet()` Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
3. What is the purpose of the `web.xml` file in a Java web application? A. To define JavaBean properties B. To execute SQL queries C. To configure servlet mappings and other web application settings D. To create JavaBeans Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
4. In Java Servlets, what is the purpose of the `HttpServletRequest` object? A. To create JavaBean properties B. To encapsulate the client's request information C. To manage JavaBean events D. None of These Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
5. Which of the following is true about session management in Java Servlets? A. Sessions are managed using SQL queries B. Sessions are not supported in Java Servlets C. Sessions can be maintained using cookies or URL rewriting D. Sessions can only be managed using cookies Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
6. What is the role of the `HttpServletResponse` object in Java Servlets? A. To execute SQL queries B. To create JavaBeans C. To manage JavaBean properties D. To encapsulate the response sent to the client Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
7. Which HTTP method is typically used for retrieving data from a server in Java Servlets? A. `GET` B. `POST` C. `PUT` D. `DELETE` Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
8. In Java Servlets, what is the purpose of the `ServletContext` object? A. To execute SQL queries B. To manage JavaBean lifecycle C. To define JavaBean properties D. To provide access to application-wide resources Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
9. What is the purpose of the `doPost()` method in Java Servlets? A. To handle HTTP GET requests B. To define JavaBean properties C. To handle HTTP POST requests D. To manage JavaBean events Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
10. In Java Servlets, what is the primary function of the `RequestDispatcher` interface? A. To manage JavaBean properties B. To forward a request from one servlet to another C. To execute SQL queries D. None of These Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board