org.apache.thrift.server

## Class TServlet

- java.lang.Object
- - javax.servlet.GenericServlet
  - - javax.servlet.http.HttpServlet
    - - org.apache.thrift.server.TServlet

- All Implemented Interfaces:
    java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

      public class TServlet
      extends javax.servlet.http.HttpServlet

  Servlet implementation class ThriftServer
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TServlet(TProcessor processor, TProtocolFactory protocolFactory)`
    `TServlet(TProcessor processor, TProtocolFactory inProtocolFactory, TProtocolFactory outProtocolFactory)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCustomHeader(java.lang.String key, java.lang.String value)`
    `protected void` | `doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)`
    `protected void` | `doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)`
    `void` | `setCustomHeaders(java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>> headers)`

    - ### Methods inherited from class javax.servlet.http.HttpServlet

      `doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service`

    - ### Methods inherited from class javax.servlet.GenericServlet

      `destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TServlet

          public TServlet(TProcessor processor,
                  TProtocolFactory inProtocolFactory,
                  TProtocolFactory outProtocolFactory)

      See Also:
        `HttpServlet.HttpServlet()`

    - #### TServlet

          public TServlet(TProcessor processor,
                  TProtocolFactory protocolFactory)

      See Also:
        `HttpServlet.HttpServlet()`

  - ### Method Detail

    - #### doPost

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

      Overrides:
        `doPost` in class `javax.servlet.http.HttpServlet`
      Throws:
        `javax.servlet.ServletException`
        `java.io.IOException`
      See Also:
        `HttpServlet.doPost(HttpServletRequest request, HttpServletResponse response)`

    - #### doGet

          protected void doGet(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
                        throws javax.servlet.ServletException,
                               java.io.IOException

      Overrides:
        `doGet` in class `javax.servlet.http.HttpServlet`
      Throws:
        `javax.servlet.ServletException`
        `java.io.IOException`
      See Also:
        `HttpServlet.doGet(HttpServletRequest request, HttpServletResponse response)`

    - #### addCustomHeader

          public void addCustomHeader(java.lang.String key,
                             java.lang.String value)

    - #### setCustomHeaders

          public void setCustomHeaders(java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>> headers)