Java Servlets Question and Answers
17. | What is the life cycle of a Servlet? |
---|---|
Three methods are central to the life cycle of a Servlet
|
|
18. | What must be implemented by all Servlets? |
---|---|
The Servlet Inteface must be implemented by all servlets. | |
19. | What is the difference between ServletContext and PageContext? |
---|---|
ServletContext: Gives the information about the container. PageContext: Gives the information about the Request. |
|
20. | Why do you use Session Tracking in HTTPServlet? |
---|---|
In HTTPServlet you can use Session Tracking to track the user state. Session is required if you are developing shopping cart application or in any e–commerce application. | |