Servlet 4.0 feature functions

The product supports the Servlet 4.0 specification.

In addition to these key features and enhancements in Servlet 4.0, descriptions of the new Servlet 4.0 functions and deprecations are provided in the Java™ Servlet 4.0 Specification.
  • The javax.servlet.GenericFilter and javax.servlet.http.HttpFilter classes are added. For more information, see the Javadoc.
  • The getHttpServletMapping method is added to the HttpServletRequest interface. For more information, see Section 12.3 of the Servlet 4.0 Specification.
  • The default-context-path element in the schema of the web.xml file is added. For more information, see the default-context-path element description in Section 14.4.30 in the Servlet 4.0 Specification.
  • The request-character-encoding and response-character-encoding elements in the schema of the web.xml file are added. For more information, see Section 14.4.31 and Section 14.4.32 of the Servlet 4.0 Specification.
  • The getRequestCharacterEncoding, setRequestCharacterEncoding, getResponseCharacterEncoding, and setResponseCharacterEncoding methods in the ServletContext interface are added. For more information, see Section 4.4.5, 3.12, and 5.6 of the Servlet 4.0 Specification.
  • The getSessionTimeout and setSessionTimeout methods in the ServletContext interface are added. For more information, see the Javadoc and Section 4.4.4 and 7.5 of the Servlet 4.0 Specification.
  • Support for the HTTP/2 push and HTTP/2 promise methods are added. Obtain ALPN support to use push support securely. ALPN support is not generally available with Java 8, and you need to obtain it.
  • Support for HTTP trailers is added. For more information, see Section 5.3, HTTP Trailers, of the Servlet 4.0 specification. Add the getTrailerFields and isTrailerFieldsReady methods in the HttpServletRequest interface, and add the setTrailerFields and getTrailerFields methods in the HttpServletResponse interface.