Java javax.servlet ServletContext fields, constructors, methods, implement or subclass

Example usage for Java javax.servlet ServletContext fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for javax.servlet ServletContext.

The text is from its open source code.

Implementation

javax.servlet.ServletContext has the following implementations.
Click this link to see all its implementation.

Field

StringTEMPDIR
The name of the ServletContext attribute which stores the private temporary directory (of type java.io.File) provided by the servlet container for the ServletContext

Constructor

Method

FilterRegistration.DynamicaddFilter(String filterName, String className)
Adds the filter with the given name and class name to this servlet context.
FilterRegistration.DynamicaddFilter(String filterName, Filter filter)
Registers the given filter instance with this ServletContext under the given filterName.
FilterRegistration.DynamicaddFilter(String filterName, Class filterClass)
Adds the filter with the given name and class type to this servlet context.
voidaddListener(String className)
Adds the listener with the given class name to this ServletContext.
voidaddListener(T t)
Adds the given listener to this ServletContext.
voidaddListener(Class listenerClass)
Adds a listener of the given class type to this ServletContext.
ServletRegistration.DynamicaddServlet(String servletName, String className)
Adds the servlet with the given name and class name to this servlet context.
ServletRegistration.DynamicaddServlet(String servletName, Servlet servlet)
Registers the given servlet instance with this ServletContext under the given servletName.
ServletRegistration.DynamicaddServlet(String servletName, Class servletClass)
Adds the servlet with the given name and class type to this servlet context.
TcreateFilter(Class clazz)
Instantiates the given Filter class.
TcreateListener(Class clazz)
Instantiates the given EventListener class.
TcreateServlet(Class clazz)
Instantiates the given Servlet class.
booleanequals(Object obj)
Indicates whether some other object is "equal to" this one.
ObjectgetAttribute(String name)
Returns the servlet container attribute with the given name, or null if there is no attribute by that name.
EnumerationgetAttributeNames()
Returns an Enumeration containing the attribute names available within this ServletContext.
ClassgetClass()
Returns the runtime class of this Object .
ClassLoadergetClassLoader()
Gets the class loader of the web application represented by this ServletContext.
ServletContextgetContext(String uripath)
Returns a ServletContext object that corresponds to a specified URL on the server.
StringgetContextPath()
Returns the context path of the web application.
intgetEffectiveMajorVersion()
Gets the major version of the Servlet specification that the application represented by this ServletContext is based on.
intgetEffectiveMinorVersion()
Gets the minor version of the Servlet specification that the application represented by this ServletContext is based on.
FilterRegistrationgetFilterRegistration(String filterName)
Gets the FilterRegistration corresponding to the filter with the given filterName.
StringgetInitParameter(String name)
Returns a String containing the value of the named context-wide initialization parameter, or null if the parameter does not exist.
EnumerationgetInitParameterNames()
Returns the names of the context's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the context has no initialization parameters.
intgetMajorVersion()
Returns the major version of the Servlet API that this servlet container supports.
StringgetMimeType(String file)
Returns the MIME type of the specified file, or null if the MIME type is not known.
intgetMinorVersion()
Returns the minor version of the Servlet API that this servlet container supports.
RequestDispatchergetNamedDispatcher(String name)
Returns a RequestDispatcher object that acts as a wrapper for the named servlet.
StringgetRealPath(String path)
Gets the real path corresponding to the given virtual path.
RequestDispatchergetRequestDispatcher(String path)
Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path.
URLgetResource(String path)
Returns a URL to the resource that is mapped to the given path.
InputStreamgetResourceAsStream(String path)
Returns the resource located at the named path as an InputStream object.
SetgetResourcePaths(String path)
Returns a directory-like listing of all the paths to resources within the web application whose longest sub-path matches the supplied path argument.
StringgetServerInfo()
Returns the name and version of the servlet container on which the servlet is running.
ServletgetServlet(String name)
StringgetServletContextName()
Returns the name of this web application corresponding to this ServletContext as specified in the deployment descriptor for this web application by the display-name element.
ServletRegistrationgetServletRegistration(String servletName)
Gets the ServletRegistration corresponding to the servlet with the given servletName.
MapgetServletRegistrations()
Gets a (possibly empty) Map of the ServletRegistration objects (keyed by servlet name) corresponding to all servlets registered with this ServletContext.
SessionCookieConfiggetSessionCookieConfig()
Gets the SessionCookieConfig object through which various properties of the session tracking cookies created on behalf of this ServletContext may be configured.
inthashCode()
Returns a hash code value for the object.
voidlog(String msg)
Writes the specified message to a servlet log file, usually an event log.
voidlog(Exception exception, String msg)
voidlog(String message, Throwable throwable)
Writes an explanatory message and a stack trace for a given Throwable exception to the servlet log file.
voidremoveAttribute(String name)
Removes the attribute with the given name from this ServletContext.
voidsetAttribute(String name, Object object)
Binds an object to a given attribute name in this ServletContext.
booleansetInitParameter(String name, String value)
Sets the context initialization parameter with the given name and value on this ServletContext.
voidsetSessionTrackingModes(Set sessionTrackingModes)
Sets the session tracking modes that are to become effective for this ServletContext.
StringtoString()
Returns a string representation of the object.