Interface IServletContext310To400Migration

    • Field Summary

      • Fields inherited from interface jakarta.servlet.ServletContext

        ORDERED_LIBS, TEMPDIR
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default jakarta.servlet.ServletRegistration.Dynamic addJspFile​(String sServletName, String sJspFile)
      Adds the servlet with the given jsp file to this servlet context.
      default String getRequestCharacterEncoding()
      Gets the request character encoding that are supported by default for this ServletContext.
      default String getResponseCharacterEncoding()
      Gets the response character encoding that are supported by default for this ServletContext.
      default int getSessionTimeout()
      Gets the session timeout in minutes that are supported by default for this ServletContext.
      default void setRequestCharacterEncoding​(String sEncoding)
      Sets the request character encoding for this ServletContext.
      default void setResponseCharacterEncoding​(String sEncoding)
      Sets the response character encoding for this ServletContext.
      default void setSessionTimeout​(int nSessionTimeout)
      Sets the session timeout in minutes for this ServletContext.
      • Methods inherited from interface jakarta.servlet.ServletContext

        addFilter, addFilter, addFilter, addListener, addListener, addListener, addServlet, addServlet, addServlet, createFilter, createListener, createServlet, declareRoles, getAttribute, getAttributeNames, getClassLoader, getContext, getContextPath, getDefaultSessionTrackingModes, getEffectiveMajorVersion, getEffectiveMinorVersion, getEffectiveSessionTrackingModes, getFilterRegistration, getFilterRegistrations, getInitParameter, getInitParameterNames, getJspConfigDescriptor, getMajorVersion, getMimeType, getMinorVersion, getNamedDispatcher, getRealPath, getRequestDispatcher, getResource, getResourceAsStream, getResourcePaths, getServerInfo, getServlet, getServletContextName, getServletNames, getServletRegistration, getServletRegistrations, getServlets, getSessionCookieConfig, log, log, log, removeAttribute, setAttribute, setInitParameter, setSessionTrackingModes
    • Method Detail

      • addJspFile

        default jakarta.servlet.ServletRegistration.Dynamic addJspFile​(String sServletName,
                                                                       String sJspFile)
        Adds the servlet with the given jsp file to this servlet context.

        The registered servlet may be further configured via the returned ServletRegistration object.

        If this ServletContext already contains a preliminary ServletRegistration for a servlet with the given servletName, it will be completed (by assigning the given jspFile to it) and returned.

        Specified by:
        addJspFile in interface jakarta.servlet.ServletContext
        Parameters:
        sServletName - the name of the servlet
        sJspFile - the full path to a JSP file within the web application beginning with a `/'.
        Returns:
        a ServletRegistration object that may be used to further configure the registered servlet, or null if this ServletContext already contains a complete ServletRegistration for a servlet with the given servletName
        Throws:
        IllegalStateException - if this ServletContext has already been initialized
        IllegalArgumentException - if servletName is null or an empty String
        UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.contextInitialized(jakarta.servlet.ServletContextEvent) method of a ServletContextListener that was neither declared in web.xml or web-fragment.xml, nor annotated with WebListener
        Since:
        Servlet 4.0
      • getSessionTimeout

        default int getSessionTimeout()
        Gets the session timeout in minutes that are supported by default for this ServletContext.
        Specified by:
        getSessionTimeout in interface jakarta.servlet.ServletContext
        Returns:
        the session timeout in minutes that are supported by default for this ServletContext
        Throws:
        UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.contextInitialized(jakarta.servlet.ServletContextEvent) method of a ServletContextListener that was neither declared in web.xml or web-fragment.xml, nor annotated with WebListener
        Since:
        Servlet 4.0
      • setSessionTimeout

        default void setSessionTimeout​(int nSessionTimeout)
        Sets the session timeout in minutes for this ServletContext.
        Specified by:
        setSessionTimeout in interface jakarta.servlet.ServletContext
        Parameters:
        nSessionTimeout - session timeout in minutes
        Throws:
        IllegalStateException - if this ServletContext has already been initialized
        UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.contextInitialized(jakarta.servlet.ServletContextEvent) method of a ServletContextListener that was neither declared in web.xml or web-fragment.xml, nor annotated with WebListener
        Since:
        Servlet 4.0
      • getRequestCharacterEncoding

        default String getRequestCharacterEncoding()
        Gets the request character encoding that are supported by default for this ServletContext. This method returns null if no request encoding character encoding has been specified in deployment descriptor or container specific configuration (for all web applications in the container).
        Specified by:
        getRequestCharacterEncoding in interface jakarta.servlet.ServletContext
        Returns:
        the request character encoding that are supported by default for this ServletContext
        Throws:
        UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.contextInitialized(jakarta.servlet.ServletContextEvent) method of a ServletContextListener that was neither declared in web.xml or web-fragment.xml, nor annotated with WebListener
        Since:
        Servlet 4.0
      • setRequestCharacterEncoding

        default void setRequestCharacterEncoding​(String sEncoding)
        Sets the request character encoding for this ServletContext.
        Specified by:
        setRequestCharacterEncoding in interface jakarta.servlet.ServletContext
        Parameters:
        sEncoding - request character encoding
        Throws:
        IllegalStateException - if this ServletContext has already been initialized
        UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.contextInitialized(jakarta.servlet.ServletContextEvent) method of a ServletContextListener that was neither declared in web.xml or web-fragment.xml, nor annotated with WebListener
        Since:
        Servlet 4.0
      • getResponseCharacterEncoding

        default String getResponseCharacterEncoding()
        Gets the response character encoding that are supported by default for this ServletContext. This method returns null if no response encoding character encoding has been specified in deployment descriptor or container specific configuration (for all web applications in the container).
        Specified by:
        getResponseCharacterEncoding in interface jakarta.servlet.ServletContext
        Returns:
        the request character encoding that are supported by default for this ServletContext
        Throws:
        UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.contextInitialized(jakarta.servlet.ServletContextEvent) method of a ServletContextListener that was neither declared in web.xml or web-fragment.xml, nor annotated with WebListener
        Since:
        Servlet 4.0
      • setResponseCharacterEncoding

        default void setResponseCharacterEncoding​(String sEncoding)
        Sets the response character encoding for this ServletContext.
        Specified by:
        setResponseCharacterEncoding in interface jakarta.servlet.ServletContext
        Parameters:
        sEncoding - response character encoding
        Throws:
        IllegalStateException - if this ServletContext has already been initialized
        UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.contextInitialized(jakarta.servlet.ServletContextEvent) method of a ServletContextListener that was neither declared in web.xml or web-fragment.xml, nor annotated with WebListener
        Since:
        Servlet 4.0