Servlet Essentials

 

javax.servlet

 

            This is the Java package that contains all of the classes used to create servlets.

 

HttpServlet

 

            The servlet classes that is subclasses to create a servlet by a webpage. 

 

doGet()

doPost()

 

            The methods used to respond to GET and POST requests.

 

HttpServletRequest

 

            The object that stores all the information from the client to a HttpServlet.

 

HttpServletResponse

 

            The object used to send information from a HttpServlet to a client.

 

getWriter() [HttpServletResponse]

getReader() [HttpServletRequest]

getQueryString() [HttpServletRequest]

setContentType() [HttpServletResponse]

 

Methods used to (respectively) get the output text stream to the client, get the input text stream from a client (POST method), get the query text from the client (GET method), and set the content-type of the response.

 

getParameter() [HttpServletRequest]

getParameters() [HttpServletRequest]

 

            Get the value or values of parameters.

 

init() [HttpServlet]

destroy() [HttpServlet]

 

init() is called when servlet is loaded. This is similar to init() of an applet. destroy() is called when a servlet is killed by the server (usually at the administrators request). This is similar to finialize().

 

For how to do cookies and session tracking, see http://www.javasoft.com/docs/books/tutorial/servlets/client-state/index.html