public interface ServletContext extends ServletContext
ORDERED_LIBS, TEMPDIR
Modifier and Type | Method and Description |
---|---|
ServletRegistration.Dynamic |
addJspFile(java.lang.String jspName,
java.lang.String jspFile) |
java.lang.String |
getRequestCharacterEncoding()
Get the default character encoding for reading request bodies.
|
java.lang.String |
getResponseCharacterEncoding()
Get the default character encoding for writing response bodies.
|
int |
getSessionTimeout()
Get the default session timeout.
|
void |
setRequestCharacterEncoding(java.lang.String encoding)
Set the default character encoding to use for reading request bodies.
|
void |
setResponseCharacterEncoding(java.lang.String encoding)
Set the default character encoding to use for writing response bodies.
|
void |
setSessionTimeout(int sessionTimeout)
Set the default session timeout.
|
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, getVirtualServerName, log, log, log, removeAttribute, setAttribute, setInitParameter, setSessionTrackingModes
int getSessionTimeout()
java.lang.UnsupportedOperationException
- If called from a
ServletContextListener.contextInitialized(ServletContextEvent)
method of a ServletContextListener
that was not defined in a
web.xml file, a web-fragment.xml file nor annotated with
WebListener
. For example, a
ServletContextListener
defined in a TLD would not be able to
use this method.void setSessionTimeout(int sessionTimeout)
sessionTimeout
- The new default session timeout in minutes.java.lang.UnsupportedOperationException
- If called from a
ServletContextListener.contextInitialized(ServletContextEvent)
method of a ServletContextListener
that was not defined in a
web.xml file, a web-fragment.xml file nor annotated with
WebListener
. For example, a
ServletContextListener
defined in a TLD would not be able to
use this method.java.lang.IllegalStateException
- If the ServletContext has already been
initialisedServletRegistration.Dynamic addJspFile(java.lang.String jspName, java.lang.String jspFile)
jspName
- The servlet name under which this JSP file should be
registeredjspFile
- The path, relative to the web application root, for the
JSP file to be used for this servletServletRegistration.Dynamic
object
that can be used to further configure the servletjava.lang.String getRequestCharacterEncoding()
null
if no default has
been specifiedjava.lang.UnsupportedOperationException
- If called from a
ServletContextListener.contextInitialized(ServletContextEvent)
method of a ServletContextListener
that was not defined in a
web.xml file, a web-fragment.xml file nor annotated with
WebListener
. For example, a
ServletContextListener
defined in a TLD would not be able to
use this method.void setRequestCharacterEncoding(java.lang.String encoding)
encoding
- The name of the character encoding to usejava.lang.UnsupportedOperationException
- If called from a
ServletContextListener.contextInitialized(ServletContextEvent)
method of a ServletContextListener
that was not defined in a
web.xml file, a web-fragment.xml file nor annotated with
WebListener
. For example, a
ServletContextListener
defined in a TLD would not be able to
use this method.java.lang.IllegalStateException
- If the ServletContext has already been
initialisedjava.lang.String getResponseCharacterEncoding()
null
if no default has
been specifiedjava.lang.UnsupportedOperationException
- If called from a
ServletContextListener.contextInitialized(ServletContextEvent)
method of a ServletContextListener
that was not defined in a
web.xml file, a web-fragment.xml file nor annotated with
WebListener
. For example, a
ServletContextListener
defined in a TLD would not be able to
use this method.void setResponseCharacterEncoding(java.lang.String encoding)
encoding
- The name of the character encoding to usejava.lang.UnsupportedOperationException
- If called from a
ServletContextListener.contextInitialized(ServletContextEvent)
method of a ServletContextListener
that was not defined in a
web.xml file, a web-fragment.xml file nor annotated with
WebListener
. For example, a
ServletContextListener
defined in a TLD would not be able to
use this method.java.lang.IllegalStateException
- If the ServletContext has already been
initialisedCopyright © 2000-2017 Apache Software Foundation. All Rights Reserved.