41.) What is the primary purpose of a URL rewriting mechanism in Java Servlets?
A) To obfuscate URL patterns for security.
B) To enhance SEO (Search Engine Optimization).
C) To enable stateless communication between the client and server.
D) To maintain session data across multiple requests.
42.) In a Servlet Filter, what is the purpose of the filterChain.doFilter(request, response) method call?
A) It skips the execution of the current filter and proceeds to the next filter.
B) It terminates the request processing and sends a response.
C) It handles authentication.
D) It sets response headers.
43.) In a Java Servlet, what is the recommended approach for handling concurrent requests?
A) Use synchronized methods in the Servlet class.
B) Use a separate thread for each request.
C) Ensure that the Servlet class is stateless.
D) Delegate request handling to a thread pool.
44.) What is connection pooling, and why is it beneficial in a Java Servlet-based application?
A) It’s a technique to secure database connections.
B) It’s a way to optimize network connections between clients and servers.
C) It’s a mechanism to reuse and manage database connections, improving performance and resource utilization.
D) It’s a caching technique for storing session data.
45.) Which of the following is a best practice for optimizing the performance of a Java Servlet-based web application?
A) Using a single monolithic Servlet for all requests.
B) Minimizing the use of caching.
C) Reducing the number of threads in the Servlet container.
D) Employing efficient algorithms and data structures.