Java Reference
In-Depth Information
<<Interface>>
javax.servlet.Servlet
init()
getServletConfig()
service()
getServletInfo()
destroy()
<<Interface>>
javax.servlet.ServletConfig
getInitParameter()
getServletContext()
getInitParameterNames()
getServletName()
<<Interface>>
java.io.Serializable
javax.servlet.GenericServlet
2
getServletContext()
getInitParameter()
getInitParameterNames()
log()
getServletInfo()
init()
getServletConfig()
service()
destroy()
getServletName()
javax.servlet.http.HttpServlet
doDelete()
doGet()
doOptions()
doPost()
doPut()
doTrace()
getLastModified()
service()
BasicServlet
F
IGURE
2.3
A high-level object model of the servlet framework.
The two objects that the
service()
method receives are
ServletRequest
and
ServletResponse
. The
ServletRequest
object holds the information that is being sent to the
servlet, whereas the
ServletResponse
object is where you place the data you want to send
back to the client. Figure 2.4 diagrams the flow of a
GenericServlet
request.