|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Servlet
This is the interface for all servlets.
Servlets handle server request.
Servlets have 5 phases in their lifespan, as follows:
init
method
somewhere between creation and the first request it ever gives
the servlet to handle.
service
method.
The server packages all the request data in a ServletRequest object, and
creates a ServletResponse object for the servlet to write reply data to.
Method Summary | |
---|---|
void |
destroy()
Called by the server when it no longer needs the servlet. |
ServletConfig |
getServletConfig()
Gets the servlet config class. |
java.lang.String |
getServletInfo()
Gets a string containing information about the servlet. |
void |
init(ServletConfig config)
Initializes the servlet. |
void |
service(ServletRequest request,
ServletResponse response)
Called by the server every time it wants the servlet to handle a request. |
Method Detail |
---|
void init(ServletConfig config) throws ServletException
ServletConfig
so it can return it again when the
getConfig()
method is called. If the the servlet is
temporarily or permanently unavailable it should throw an
UnavailableException
.
config
- This servlet configuration class
ServletException
- If an unexpected error occurs
UnavailableException
- If servlet is temporarily or permanently
unavailableUnavailableException
void service(ServletRequest request, ServletResponse response) throws java.io.IOException, ServletException
SingleThreadModel
interface.
request
- all the request informationresponse
- class to write all the response data to
ServletException
- If an error occurs
java.io.IOException
- If an error occursSingleThreadModel
void destroy()
ServletConfig getServletConfig()
ServletConfig
that was handed to the init()
method.
java.lang.String getServletInfo()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |