| Modifier and Type | Field and Description |
|---|---|
| private static final Class | |
| private Method | |
| private String | |
| private Method | |
| private String | |
| private Method | |
| private String | |
| private Object | |
| private Method | |
| private String | |
| private Method | |
| private String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | doDelete(HttpServletRequest
the req, HttpServletResponse HttpServletRequest object that
contains the request the client made of
the servletthe resp)HttpServletResponse object that
contains the response the servlet returns
to the clientOverrides javax. service method)
to allow a servlet to handle a DELETE request.
|
| protected void | doGet(HttpServletRequest
an req, HttpServletResponse HttpServletRequest object that
contains the request the client has made
of the servletan resp)HttpServletResponse object that
contains the response the servlet sends
to the clientOverrides javax. service method) to
allow a servlet to handle a GET request.
|
| protected void | doHead(HttpServletRequest
the request object that is passed to the servlet req, HttpServletResponse the response object that the servlet
uses to return the headers to the clien resp)Overrides javax. Receives an HTTP HEAD request from the protected
|
| protected void | doPost(HttpServletRequest
an req, HttpServletResponse HttpServletRequest object that
contains the request the client has made
of the servletan resp)HttpServletResponse object that
contains the response the servlet sends
to the clientOverrides javax. service method)
to allow a servlet to handle a POST request.
|
| protected void | doPut(HttpServletRequest
the req, HttpServletResponse HttpServletRequest object that
contains the request the client made of
the servletthe resp)HttpServletResponse object that
contains the response the servlet returns
to the clientOverrides javax. service method)
to allow a servlet to handle a PUT request.
|
| public String | |
| public String | |
| public String | |
| public Object | |
| public String | |
| public String | |
| public void | init()
Overrides javax. super.init(config).
|
| private void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void |
| __params | back to summary |
|---|---|
| private static final Class<T>[] __params | |
| _deleteMethod | back to summary |
|---|---|
| private Method _deleteMethod | |
| _deleteMethodName | back to summary |
|---|---|
| private String _deleteMethodName | |
| _getMethod | back to summary |
|---|---|
| private Method _getMethod | |
| _getMethodName | back to summary |
|---|---|
| private String _getMethodName | |
| _headMethod | back to summary |
|---|---|
| private Method _headMethod | |
| _headMethodName | back to summary |
|---|---|
| private String _headMethodName | |
| _pojo | back to summary |
|---|---|
| private Object _pojo | |
| _postMethod | back to summary |
|---|---|
| private Method _postMethod | |
| _postMethodName | back to summary |
|---|---|
| private String _postMethodName | |
| _putMethod | back to summary |
|---|---|
| private Method _putMethod | |
| _putMethodName | back to summary |
|---|---|
| private String _putMethodName | |
| PojoServlet | back to summary |
|---|---|
| public PojoServlet(Object pojo) | |
| doDelete | back to summary |
|---|---|
| protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException Overrides javax. Doc from javax. Called by the server (via the This method does not need to be either safe or idempotent. Operations requested through DELETE can have side effects for which users can be held accountable. When using this method, it may be useful to save a copy of the affected URL in temporary storage. If the HTTP DELETE request is incorrectly formatted,
| |
| doGet | back to summary |
|---|---|
| protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException Overrides javax. Doc from javax. Called by the server (via the Overriding this method to support a GET request also automatically supports an HTTP HEAD request. A HEAD request is a GET request that returns no body in the response, only the request header fields. When overriding this method, read the request data,
write the response headers, get the response's writer or
output stream object, and finally, write the response data.
It's best to include content type and encoding. When using
a The servlet container must write the headers before committing the response, because in HTTP the headers must be sent before the response body. Where possible, set the Content-Length header (with the
When using HTTP 1.1 chunked encoding (which means that the response has a Transfer-Encoding header), do not set the Content-Length header. The GET method should be safe, that is, without any side effects for which users are held responsible. For example, most form queries have no side effects. If a client request is intended to change stored data, the request should use some other HTTP method. The GET method should also be idempotent, meaning that it can be safely repeated. Sometimes making a method safe also makes it idempotent. For example, repeating queries is both safe and idempotent, but buying a product online or modifying data is neither safe nor idempotent. If the request is incorrectly formatted,
| |
| doHead | back to summary |
|---|---|
| protected void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException Overrides javax. Doc from javax. Receives an HTTP HEAD request from the protected
If you override this method, you can avoid computing
the response body and just set the response headers
directly to improve performance. Make sure that the
If the HTTP HEAD request is incorrectly formatted,
| |
| doPost | back to summary |
|---|---|
| protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException Overrides javax. Doc from javax. Called by the server (via the When overriding this method, read the request data,
write the response headers, get the response's writer or output
stream object, and finally, write the response data. It's best
to include content type and encoding. When using a
The servlet container must write the headers before committing the response, because in HTTP the headers must be sent before the response body. Where possible, set the Content-Length header (with the
When using HTTP 1.1 chunked encoding (which means that the response has a Transfer-Encoding header), do not set the Content-Length header. This method does not need to be either safe or idempotent. Operations requested through POST can have side effects for which the user can be held accountable, for example, updating stored data or buying items online. If the HTTP POST request is incorrectly formatted,
| |
| doPut | back to summary |
|---|---|
| protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException Overrides javax. Doc from javax. Called by the server (via the When overriding this method, leave intact any content headers sent with the request (including Content-Length, Content-Type, Content-Transfer-Encoding, Content-Encoding, Content-Base, Content-Language, Content-Location, Content-MD5, and Content-Range). If your method cannot handle a content header, it must issue an error message (HTTP 501 - Not Implemented) and discard the request. For more information on HTTP 1.1, see RFC 2616 . This method does not need to be either safe or idempotent.
Operations that If the HTTP PUT request is incorrectly formatted,
| |
| getDeleteMethodName | back to summary |
|---|---|
| public String getDeleteMethodName() | |
| getGetMethodName | back to summary |
|---|---|
| public String getGetMethodName() | |
| getHeadMethodName | back to summary |
|---|---|
| public String getHeadMethodName() | |
| getPojo | back to summary |
|---|---|
| public Object getPojo() Implements org. | |
| getPostMethodName | back to summary |
|---|---|
| public String getPostMethodName() | |
| getPutMethodName | back to summary |
|---|---|
| public String getPutMethodName() | |
| init | back to summary |
|---|---|
| public void init() throws ServletException Overrides javax. Doc from javax. A convenience method which can be overridden so that there's no need
to call Instead of overriding
| |
| invoke | back to summary |
|---|---|
| private void invoke(Method method, HttpServletRequest req, HttpServletResponse resp) throws ServletException | |
| setDeleteMethodName | back to summary |
|---|---|
| public void setDeleteMethodName(String name) | |
| setGetMethodName | back to summary |
|---|---|
| public void setGetMethodName(String name) | |
| setHeadMethodName | back to summary |
|---|---|
| public void setHeadMethodName(String name) | |
| setPostMethodName | back to summary |
|---|---|
| public void setPostMethodName(String name) | |
| setPutMethodName | back to summary |
|---|---|
| public void setPutMethodName(String name) | |