Class FourOhFourServlet

java.lang.Object
jakarta.servlet.GenericServlet
com.atlassian.confluence.impl.webapp.FourOhFourServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public class FourOhFourServlet extends jakarta.servlet.GenericServlet

Servlet that always returns a 404.

Introduced with the purpose of taking precedence over any container-default JSP-handling servlet, effectively disabling it. This saves needing container-specific XML configuration that is prone to regression.

Disabling the JSP-handling servlet prevents JSPs from being compiled and served directly at runtime, which can lead to an instant RCE if even a single file or disk write is compromised. Instead, all JSPs must be compiled to Servlet classes at build-time and registered in Servlets.

Since:
8.8.0
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    service(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res)
     

    Methods inherited from class jakarta.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 Details

    • FourOhFourServlet

      public FourOhFourServlet()
  • Method Details

    • service

      public void service(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res) throws jakarta.servlet.ServletException, IOException
      Specified by:
      service in interface jakarta.servlet.Servlet
      Specified by:
      service in class jakarta.servlet.GenericServlet
      Throws:
      jakarta.servlet.ServletException
      IOException