The Workshop is designed to help you review what you have learned and help you to further increase your understanding of the material covered in this chapter.
A ServletConfig object provides access to JSP or servlet specific initialization parameters and to a servlet context. It can also give you the name of the servlet or JSP as defined in the deployment descriptor.
A servlet or JSP is only destroyed when the application or container is shut down, or when the container decides to unload the JSP or servlet for some reason. (It may do this for performance.) They are not destroyed at the end of processing a request; remember that Web components are often reused.
An object that implements ServletRequestListener is appropriate. This interface will let you know when servicing a request begins and when the request is about to be destroyed.
Activities
Write a JSP that reads several initialization parameters and outputs them to a Web page.
Run the listener example and reload the browser page so that the JSP is invoked more than once. Note which events occur each time the JSP is invoked.
Extend the example to use a ServletRequestListener so that you can see when requests begin to be processed.