Phase 2 Deadline -- Thurs. Nov. 5 @ 6 PM. Servlets A servlet is a server side application that handles requests from clients. - Most servlets are threaded, meaning clients can be handled concurrently. * Behavior of doGet() and doPost(). * Most of the time a servlet creates a thread to service a client, provides the service, and the thread dies. - Servlets have state, i.e. they can hold values indefinitely while they are deployed. - Servlets are loaded when first accessed, not when they are deployed. - web.xml directs how a URL is used to access the actual servlet class * the URL need not actually show the path. It can when the servlet is in the classes directory. -> You can't have a servlet right in the classes directory in GWT -> GWT packages its stuff and a servlet below the classes directory has to be part of a package. Continuing on Oct 28 2020 .... In accessing a servlet, the directory comes first, followed by the handle for the servlet. - This handle is interpreted within the and xml tags. * web.xml takes the servlet's url mapping and directs it to the actual servlet class. - The tag associates a name (designated in ) for the servlet with the actual class. The tag associates the URL with the servlet's name, i.e. The classes directory in a deployment is in the classpath. The HttpServletResponse provides a Writer that writes directly to the requestor. - If the request is directly from a web page, the response overwrites the content with whatever the HttpServletResponse sends. service() is part of GenericServlet. - We use the do___() functions because those can be accessed via an html form. In making a service request, there's several methods. GET & POST are most prevalent. - GET encodes the form data in the URL query string - POST provides the data via the session's request header.