SSIServlet (Apache Tomcat 10.1.48 API Documentation)
Description: declaration: package: org.apache.catalina.ssi, class: SSIServlet

# Class SSIServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.apache.catalina.ssi.SSIServlet

All Implemented Interfaces:
  `Servlet, ServletConfig, Serializable`

public class SSIServlet extends HttpServlet
Servlet to process SSI requests within a webpage. Mapped to a path from within web.xml.

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected boolean`
  `allowExec`
  Allow exec (normally blocked for security)
  `protected boolean`
  `buffered`
  Should the output be buffered.
  `protected int`
  `debug`
  Debug level for this servlet.
  `protected Long`
  `expires`
  Expiration time in seconds for the doc.
  `protected String`
  `inputEncoding`
  Input encoding.
  `protected boolean`
  `isVirtualWebappRelative`
  virtual path can be webapp-relative
  `protected String`
  `outputEncoding`
  Output encoding.

  ### Fields inherited from class HttpServlet

  `LEGACY_DO_HEAD`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SSIServlet()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `doGet(HttpServletRequest req, HttpServletResponse res)`
  Process and forward the GET request to our `requestHandler()`.
  `void`
  `doPost(HttpServletRequest req, HttpServletResponse res)`
  Process and forward the POST request to our `requestHandler()`.
  `void`
  `init()`
  A convenience method which can be overridden so that there's no need to call `super.init(config)`.
  `protected void`
  `processSSI(HttpServletRequest req, HttpServletResponse res, URL resource)`
  `protected void`
  `requestHandler(HttpServletRequest req, HttpServletResponse res)`
  Process our request and locate right SSI command.

  ### Methods inherited from class HttpServlet

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

  ### Methods inherited from class GenericServlet

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

  ### Methods inherited from class Object

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

- ## Field Details

  - ### debug

    protected int debug
    Debug level for this servlet.

  - ### buffered

    protected boolean buffered
    Should the output be buffered.

  - ### expires

    protected Long expires
    Expiration time in seconds for the doc.

  - ### isVirtualWebappRelative

    protected boolean isVirtualWebappRelative
    virtual path can be webapp-relative

  - ### inputEncoding

    protected String inputEncoding
    Input encoding. If not specified, uses platform default

  - ### outputEncoding

    protected String outputEncoding
    Output encoding. If not specified, uses platform default

  - ### allowExec

    protected boolean allowExec
    Allow exec (normally blocked for security)

- ## Constructor Details

  - ### SSIServlet

    public SSIServlet()

- ## Method Details

  - ### init

    public void init() throws ServletException
    Description copied from class: `jakarta.servlet.GenericServlet`
    A convenience method which can be overridden so that there's no need to call `super.init(config)`.

    Instead of overriding `GenericServlet.init(ServletConfig)`, simply override this method and it will be called by `GenericServlet.init(ServletConfig config)`. The `ServletConfig` object can still be retrieved via `GenericServlet.getServletConfig()`.

    Overrides:
      `init` in class `GenericServlet`
    Throws:
      `ServletException` - if an exception occurs that interrupts the servlet's normal operation

  - ### doGet

    public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException
    Process and forward the GET request to our `requestHandler()`.
    Overrides:
      `doGet` in class `HttpServlet`
    Parameters:
      `req` - a value of type 'HttpServletRequest'
      `res` - a value of type 'HttpServletResponse'
    Throws:
      `IOException` - if an error occurs
      `ServletException` - if an error occurs
    See Also:
      - `ServletResponse.setContentType(String)`

  - ### doPost

    public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException
    Process and forward the POST request to our `requestHandler()`.
    Overrides:
      `doPost` in class `HttpServlet`
    Parameters:
      `req` - a value of type 'HttpServletRequest'
      `res` - a value of type 'HttpServletResponse'
    Throws:
      `IOException` - if an error occurs
      `ServletException` - if an error occurs
    See Also:
      - `ServletOutputStream`
      - `ServletResponse.setContentType(String)`

  - ### requestHandler

    protected void requestHandler(HttpServletRequest req, HttpServletResponse res) throws IOException
    Process our request and locate right SSI command.
    Parameters:
      `req` - a value of type 'HttpServletRequest'
      `res` - a value of type 'HttpServletResponse'
    Throws:
      `IOException` - an IO error occurred

  - ### processSSI

    protected void processSSI(HttpServletRequest req, HttpServletResponse res, URL resource) throws IOException
    Throws:
      `IOException`