Package com.helger.servlet.spec
Interface IServletContext310To400Migration
-
- All Superinterfaces:
IServletContext300To310Migration,jakarta.servlet.ServletContext
- All Known Implementing Classes:
MockServletContext
public interface IServletContext310To400Migration extends IServletContext300To310Migration
Dummy interface with all ServletContext default methods for new methods in Servlet Spec 4.0.0 compared to 3.1.0- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default jakarta.servlet.ServletRegistration.DynamicaddJspFile(String sServletName, String sJspFile)Adds the servlet with the given jsp file to this servlet context.default StringgetRequestCharacterEncoding()Gets the request character encoding that are supported by default for thisServletContext.default StringgetResponseCharacterEncoding()Gets the response character encoding that are supported by default for thisServletContext.default intgetSessionTimeout()Gets the session timeout in minutes that are supported by default for thisServletContext.default voidsetRequestCharacterEncoding(String sEncoding)Sets the request character encoding for this ServletContext.default voidsetResponseCharacterEncoding(String sEncoding)Sets the response character encoding for this ServletContext.default voidsetSessionTimeout(int nSessionTimeout)Sets the session timeout in minutes for this ServletContext.-
Methods inherited from interface com.helger.servlet.spec.IServletContext300To310Migration
getVirtualServerName
-
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
ServletRegistrationobject.If this ServletContext already contains a preliminary ServletRegistration for a servlet with the given
servletName, it will be completed (by assigning the givenjspFileto it) and returned.- Specified by:
addJspFilein interfacejakarta.servlet.ServletContext- Parameters:
sServletName- the name of the servletsJspFile- 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
nullif this ServletContext already contains a complete ServletRegistration for a servlet with the givenservletName - Throws:
IllegalStateException- if this ServletContext has already been initializedIllegalArgumentException- ifservletNameis null or an empty StringUnsupportedOperationException- if this ServletContext was passed to theServletContextListener.contextInitialized(jakarta.servlet.ServletContextEvent)method of aServletContextListenerthat was neither declared inweb.xmlorweb-fragment.xml, nor annotated withWebListener- Since:
- Servlet 4.0
-
getSessionTimeout
default int getSessionTimeout()
Gets the session timeout in minutes that are supported by default for thisServletContext.- Specified by:
getSessionTimeoutin interfacejakarta.servlet.ServletContext- Returns:
- the session timeout in minutes that are supported by default for
this
ServletContext - Throws:
UnsupportedOperationException- if this ServletContext was passed to theServletContextListener.contextInitialized(jakarta.servlet.ServletContextEvent)method of aServletContextListenerthat was neither declared inweb.xmlorweb-fragment.xml, nor annotated withWebListener- Since:
- Servlet 4.0
-
setSessionTimeout
default void setSessionTimeout(int nSessionTimeout)
Sets the session timeout in minutes for this ServletContext.- Specified by:
setSessionTimeoutin interfacejakarta.servlet.ServletContext- Parameters:
nSessionTimeout- session timeout in minutes- Throws:
IllegalStateException- if this ServletContext has already been initializedUnsupportedOperationException- if this ServletContext was passed to theServletContextListener.contextInitialized(jakarta.servlet.ServletContextEvent)method of aServletContextListenerthat was neither declared inweb.xmlorweb-fragment.xml, nor annotated withWebListener- Since:
- Servlet 4.0
-
getRequestCharacterEncoding
default String getRequestCharacterEncoding()
Gets the request character encoding that are supported by default for thisServletContext. 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:
getRequestCharacterEncodingin interfacejakarta.servlet.ServletContext- Returns:
- the request character encoding that are supported by default for
this
ServletContext - Throws:
UnsupportedOperationException- if this ServletContext was passed to theServletContextListener.contextInitialized(jakarta.servlet.ServletContextEvent)method of aServletContextListenerthat was neither declared inweb.xmlorweb-fragment.xml, nor annotated withWebListener- Since:
- Servlet 4.0
-
setRequestCharacterEncoding
default void setRequestCharacterEncoding(String sEncoding)
Sets the request character encoding for this ServletContext.- Specified by:
setRequestCharacterEncodingin interfacejakarta.servlet.ServletContext- Parameters:
sEncoding- request character encoding- Throws:
IllegalStateException- if this ServletContext has already been initializedUnsupportedOperationException- if this ServletContext was passed to theServletContextListener.contextInitialized(jakarta.servlet.ServletContextEvent)method of aServletContextListenerthat was neither declared inweb.xmlorweb-fragment.xml, nor annotated withWebListener- Since:
- Servlet 4.0
-
getResponseCharacterEncoding
default String getResponseCharacterEncoding()
Gets the response character encoding that are supported by default for thisServletContext. 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:
getResponseCharacterEncodingin interfacejakarta.servlet.ServletContext- Returns:
- the request character encoding that are supported by default for
this
ServletContext - Throws:
UnsupportedOperationException- if this ServletContext was passed to theServletContextListener.contextInitialized(jakarta.servlet.ServletContextEvent)method of aServletContextListenerthat was neither declared inweb.xmlorweb-fragment.xml, nor annotated withWebListener- Since:
- Servlet 4.0
-
setResponseCharacterEncoding
default void setResponseCharacterEncoding(String sEncoding)
Sets the response character encoding for this ServletContext.- Specified by:
setResponseCharacterEncodingin interfacejakarta.servlet.ServletContext- Parameters:
sEncoding- response character encoding- Throws:
IllegalStateException- if this ServletContext has already been initializedUnsupportedOperationException- if this ServletContext was passed to theServletContextListener.contextInitialized(jakarta.servlet.ServletContextEvent)method of aServletContextListenerthat was neither declared inweb.xmlorweb-fragment.xml, nor annotated withWebListener- Since:
- Servlet 4.0
-
-