: Class UploadServlet

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.mortbay.Jetty
Class UploadServlet

    java.lang.Object
      |
      +--javax.servlet.GenericServlet
            |
            +--javax.servlet.http.HttpServlet
                  |
                  +--com.mortbay.Jetty.UploadServlet

public class UploadServlet
extends javax.servlet.http.HttpServlet

See Also:
  Serialized Form

Constructor Summary
`UploadServlet()`

Method Summary
`void` | `doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)` Receives an HTTP POST request from the protected `service` method and handles the request.

Methods inherited from class javax.servlet.http.HttpServlet
`doDelete, doGet, doOptions, doPut, doTrace, getLastModified, service, service`

Methods inherited from class javax.servlet.GenericServlet
`destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, init, init, log, log`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### UploadServlet

    public UploadServlet()

Method Detail

### doPost

    public void doPost(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
                throws java.io.IOException

  Description copied from class: javax.servlet.http.HttpServlet
  Receives an HTTP POST request from the protected `service` method and handles the request. The HTTP POST method allows the client to send data of unlimited length to the Web server once and is useful when posting information such as credit card numbers.

  If you override this method, you should read data from the `HttpServletRequest` object, set headers for the response (including Content-Type and Content-Encoding), access a `PrintWriter` or output stream object, and then write any response data using a `ServletOutputStream` object.

  If you use a `PrintWriter` object to write response data, set the Content-Type header before you access the `PrintWriter` object. The servlet engine must write the headers before the the response data, because the headers can be flushed at any time after the servlet engine begins to write the body of the response.

  If you use HTTP 1.1 chunked encoding (which means that the response has a Transfer-Encoding header), do not set the Content-Length header. If you do not use chunked encoding, set the content length to allow the servlet to take advantage of the HTTP "connection keep alive" feature, If you cannot set the content length and therefore cannot use "keep alive," you may be able to avoid the performance penalty if the response fits in an internal buffer.

  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, `doPost` returns an HTTP BAD_REQUEST message.

  Overrides:
    doPost in class javax.servlet.http.HttpServlet
  Tags copied from class: javax.servlet.http.HttpServlet
  Parameters:
    `req` - an `HttpServletRequest` object that contains the request the client has made of the servlet
    `resp` - an `HttpServletResponse` object that contains the response the servlet sends to the object
  Throws:
    java.io.IOException - if an input or output error is detected when the servlet handles the request
    javax.servlet.ServletException - if the request for the POST could not be handled
  See Also:
    `ServletOutputStream`, `ServletResponse.setContentType(java.lang.String)`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD