|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A class can implement the MethodHandler
interface when it
wishes to service requests via a particular HTTP method. The
Davenport servlet registers a method handler for a particular method,
and dispatches requests to that handler.
To install a handler,
MethodHandler
interface. The implementing class must also provide a no-arg
constructor.MethodHandler
.com.foo.MyGetHandler
designed to service HTTP GET requests, you would add the following to the
Davenport deployment descriptor:
<init-param> <param-name>handler.GET</param-name> <param-value>com.foo.MyGetHandler</param-value> </init-param>
Field Summary | |
static int |
SC_FAILED_DEPENDENCY
Status code (424) indicating that the method could not be performed because an action upon which this action depends failed. |
static int |
SC_INSUFFICIENT_STORAGE
Status code (507) indicating that the method could not be performed on a resource because the server is unable to store the representation needed to successfully complete the request. |
static int |
SC_LOCKED
Status code (423) indicating that the source or destination resource of a method is locked. |
static int |
SC_MULTISTATUS
Status code (207) providing status for multiple independent operations. |
static int |
SC_PROCESSING
Interim status code (102) indicating that the server has accepted the request but has not yet completed it. |
static int |
SC_UNPROCESSABLE_ENTITY
Status code (422) indicating that the server understands the content type of the request entity, and the syntax of the request entity is correct, but the contained instructions could not be processed. |
Method Summary | |
void |
destroy()
Called by the Davenport servlet to indicate that the handler is being taken out of service. |
void |
init(javax.servlet.ServletConfig config)
Called by the Davenport servlet to indicate that the handler is being placed into service. |
void |
service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
jcifs.smb.NtlmPasswordAuthentication auth)
Called by the Davenport servlet to allow the handler to service a request. |
Field Detail |
public static final int SC_PROCESSING
public static final int SC_MULTISTATUS
public static final int SC_UNPROCESSABLE_ENTITY
public static final int SC_LOCKED
public static final int SC_FAILED_DEPENDENCY
public static final int SC_INSUFFICIENT_STORAGE
Method Detail |
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
Servlet
init
method; the method is called exactly once after
instantiation.
config
- a ServletConfig
object containing
the Davenport servlet's configuration and initialization parameters.
javax.servlet.ServletException
- If an error occurs during initialization.public void destroy()
Servlet
destroy
method. This method
gives the handler an opportunity to clean up any resources that
are being held. After this method has been called, the
service
method will not be invoked again.
public void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, jcifs.smb.NtlmPasswordAuthentication auth) throws java.io.IOException, javax.servlet.ServletException
request
- The request that is being serviced.response
- The servlet response object.auth
- The authentication information provided by the user.
java.io.IOException
- If an input or output exception occurs.
javax.servlet.ServletException
- If an exception occurs that interferes with
normal operation.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |