| Methods | Description |
|---|---|
| Object getAttribute(String name) | Returns the container attribute for specified name. |
| void setAttribute(String name, Object obj) | Sets the given ServletContext object in the application scope. |
| void removeAttribute(String name) | It removes the attribute with specified name from ServletContext. |
| String getContextPath( ) | Returns the context path of the web application. |
| String getInitParameterName(String name) | Returns a String value of initialize context parameter. |
| String getRealPath(String path) | Returns the real path corresponding to given virtual path. |
| int getMajorVersion( ) | Returns the major version of the Servlet API that the servlet container supports. |
ServletContext app = getServletConfig( ).getServletContext( );
Or
ServletContext app = getServletContext( );