Home > Java Programming > Quizzes > Advanced Java Practice Test: Basics of Java Servlets
Advanced Java Practice Test: Basics of Java Servlets
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 40% Most missed: “A deployment descriptor describes”

A Java servlet (now, Jakarta servlet) is a Java programming language class that is used to extend the capabilities of servers that host applications accessed by means of a request-response programming model. Although servlets can respond to any type of request, they are commonly used to extend the applications hosted by web servers.
 

Advanced Java Practice Test: Basics of Java Servlets
Time left 00:00
25 Questions

1. Sessions is a part of the SessionTracking and it is for maintaining the client state at server side.
2. How is the dynamic interception of requests and responses to transform the information done?
3. Which class can handle any type of request so that it is protocol-independent?
4. A deployment descriptor describes
5. The sendRedirect() method of HttpServletResponse interface can be used to redirect response to another resource, it may be servlet, jsp or html file
6. The values of and in web.xml file
7. Which of the following are interface? 1. ServletContext 2. Servlet 3. GenericServlet 4. HttpServlet
8. Which HTTP Request method is non-idempotent?
9. What type of servlets use these methods doGet(), doPost(),doHead, doDelete(), doTrace()?
10. Which of the following code is used to get an attribute in a HTTP Session object in servlets?
11. Web server is used for loading the init() method of servlet.
12. How many techniques are used in Session Tracking?
13. Which method is used to send the same request and response objects to another servlet in RequestDispacher ?
14. When destroy() method of a filter is called?
15. In HTTP Request method Get request is secured because data is exposed in URL bar
16. Servlets handle multiple simultaneous requests by using threads.
17. Which method is used to specify before any lines that uses the PintWriter?
18. In the following statements identify the disadvantages of CGI?
19. What is the difference between servlets and applets? i. Servlets execute on Server; Applets execute on browser ii. Servlets have no GUI; Applet has GUI iii. Servlets creates static web pages; Applets creates dynamic web pages iv. Servlets can handle only a single request; Applet can handle multiple requests
20. Servlet technology is used to create web application
21. Which are the session tracking techniques? i. URL rewriting ii. Using session object iii.Using response object iv. Using hidden fields v. Using cookies vi. Using servlet object
22. Which cookie it is valid for single session only and it is removed each time when the user closes the browser?
23. The life cycle of a servlet is managed by
24. 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?
25. Which are the examples of Application Server?