The document outlines various concepts and tasks related to the Servlet API, including the use of GET and POST methods, session management, and the lifecycle of servlets. It provides practical examples such as writing servlets for registration and login, managing sessions, and using filters. Additionally, it discusses the roles of ServletContext and ServletConfig, as well as the differences between various servlet-related concepts.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
10 views2 pages
Unit 3
The document outlines various concepts and tasks related to the Servlet API, including the use of GET and POST methods, session management, and the lifecycle of servlets. It provides practical examples such as writing servlets for registration and login, managing sessions, and using filters. Additionally, it discusses the roles of ServletContext and ServletConfig, as well as the differences between various servlet-related concepts.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
UNIT 3: SERVLET API AND OVERVIEW
1. Discuss the use of GET and POST with example.
2. What is session? List the different ways to manage the session. 3. Discuss the possible uses of the ServletContext and ServletConfig object. 4. Write a servlet RegistrationServlet to get the values from registration.html html page and display the contents. Write the web.xml file. 5. What is Filter? List the applications of filter. 6. What is Servlet? Briefly explain the Servlet life cycle. 7. Write a Login servlet. Take input username and password from html file login.html and authenticate the user. Write the web.xml. 8. How to delete a session in servlet? 9. How to get the name of the HTTP method with which the request was made? 10. How to get the fully qualified name of the client that sent the request in servlet? 11. Design a form to input details of an employee and submit the data to a servlet. Write code for servlet that will save the entered details as a new record in database table Employee with fields (EmpId, EName, Email, Age). 12. What is Request Dispatcher? What is the difference between Request dispatcher’s forward() and include() method? 13. Explain various Session tracking mechanisms in servlet with example. 14. List different filter interfaces with their important methods 15. Explain Request and Response object in Servlet. 16. Write a Java Servlet to demonstrate the use of Session Management 17. How does the JVM exec ute a servlet compared with a regular Java class? 18. Consider a scenario in which 4 users are accessing a servlet instance. Among which one user called destroy() method. What happens to the rest 3 users? 19. What happens if you add a main method to servlet? 20. Servlet is Java class. Then why there is no constructor in Servlet? Can we write the constructor in Servlet? Justify your answer. 21. Differentiate the followings: ( I ) GenericServlet vs HttpServlet (II) doGet() vs doPost() (III) Servlets vs CGI (IV) Session and Cookie 22. Write servlet which displayed following information of client. I. Client Browser II. Client IP address III. Client Port No IV. Server Port No V. Local Port No VI. Method used by client for form submission VII. Query String name and values 23. Explain role of web container. 24. Explain difference between ServletConfig and ServletContext object. 25. Write a Servlet that takes two numbers as an input and display all the prime numbers between them. Also write web.xml description for the servlet.