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.GenericFilterandjavax.servlet.http.HttpFilterclasses are added. For more information, see the Javadoc. - The
getHttpServletMappingmethod is added to theHttpServletRequestinterface. For more information, see Section 12.3 of the Servlet 4.0 Specification. - The
default-context-pathelement 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-encodingandresponse-character-encodingelements 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, andsetResponseCharacterEncodingmethods in theServletContextinterface are added. For more information, see Section 4.4.5, 3.12, and 5.6 of the Servlet 4.0 Specification. - The
getSessionTimeoutandsetSessionTimeoutmethods in theServletContextinterface 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 pushandHTTP/2 promisemethods 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
getTrailerFieldsandisTrailerFieldsReadymethods in theHttpServletRequestinterface, and add thesetTrailerFieldsandgetTrailerFieldsmethods in theHttpServletResponseinterface.