All Packages Class Hierarchy This Package Previous Next Index
Class org.apache.tomcat.core.Context
java.lang.Object
|
+----org.apache.tomcat.core.Context
- public class Context
- extends Object
Context represent a Web Application as specified by Servlet Specs.
The implementation is a repository for all the properties
defined in web.xml and tomcat specific properties, with all the
functionality delegated to interceptors.
- Author:
- James Duncan Davidson [duncan@eng.sun.com], James Todd [gonzo@eng.sun.com], Jason Hunter [jch@eng.sun.com], Harish Prabandham, costin@dnt.ro, Gal Shachor shachor@il.ibm.com
-
Context()
-
-
addContentType(String, String)
-
-
addContextInterceptor(ContextInterceptor)
-
Deprecated.
-
addEnvEntry(String, String, String, String)
- Add Env-entry to this context
-
addErrorPage(String, String)
-
-
addInitParameter(String, String)
-
-
addRequestInterceptor(RequestInterceptor)
-
Deprecated.
-
addSecurityConstraint(String[], String[], String[], String)
-
-
addServlet(ServletWrapper)
- Add a servlet with the given name to the container.
-
addServletMapping(String, String)
- Maps a named servlet to a particular path or extension.
-
addTaglib(String, String)
- Add a taglib declaration for this context
-
addWelcomeFile(String)
-
-
expectUserWelcomeFiles()
- If any new welcome file is added, remove the old list of
welcome files and start a new one.
-
getAttribute(String)
-
-
getAttributeNames()
-
-
getAuthMethod()
- Authentication method, if any specified
-
getContainer(String)
-
-
getContainerLocations()
-
-
getContainers()
-
-
getContextInterceptors()
- Return the context interceptors as an array.
Deprecated.
-
getContextManager()
-
-
getDebug()
-
-
getDefaultServlet()
-
-
getDescription()
-
-
getDocBase()
-
-
getDocumentBase()
-
Deprecated.
-
getEngineHeader()
-
Deprecated.
-
getEnvEntries()
-
-
getEnvEntryType(String)
-
-
getEnvEntryValue(String)
-
-
getErrorPage(int)
-
-
getErrorPage(String)
-
-
getFormErrorPage()
-
-
getFormLoginPage()
-
-
getInitParameter(String)
-
-
getInitParameterNames()
-
-
getMimeMap()
-
-
getNamedDispatcher(String)
-
-
getPath()
-
-
getRealmName()
- Realm to be used
-
getReloadable()
- Should we reload servlets ?
-
getRequestDispatcher(String)
-
-
getRequestInterceptors()
- Return the context interceptors as an array.
Deprecated.
-
getRequestSecurityProvider()
-
Deprecated.
-
getResource(String)
- Implements getResource() - use a sub-request to let interceptors do the job.
-
getServletByName(String)
-
-
getServletLoader()
-
-
getServletNames()
-
-
getSessionManager()
-
-
getSessionTimeOut()
-
-
getTaglibLocation(String)
-
-
getTaglibs()
-
-
getWARDir()
-
Deprecated.
-
getWelcomeFiles()
-
-
getWorkDir()
-
Deprecated.
-
isDistributable()
-
-
isInvokerEnabled()
-
Deprecated.
-
isWARExpanded()
-
Deprecated.
-
isWARValidated()
-
Deprecated.
-
isWorkDirPersistent()
-
Deprecated.
-
log(String)
- Internal log method
-
log(String, Throwable)
-
-
logServlet(String, Throwable)
- User-level log method ( called from a servlet)
-
removeAttribute(String)
-
-
removeContainer(Container)
-
-
removeServletByName(String)
- Remove the servlet with a specific name
-
removeWelcomeFiles()
-
Deprecated.
-
setAttribute(String, Object)
-
-
setContextManager(ContextManager)
-
-
setDebug(int)
-
-
setDebug(String)
-
-
setDescription(String)
-
-
setDistributable(boolean)
-
-
setDocBase(String)
- DocBase points to the web application files.
-
setDocumentBase(URL)
-
Deprecated.
-
setEngineHeader(String)
-
Deprecated.
-
setIcon(String)
-
-
setInitParameter(String, String)
-
Deprecated.
-
setInvokerEnabled(boolean)
-
Deprecated.
-
setIsWARExpanded(boolean)
-
Deprecated.
-
setIsWARValidated(boolean)
-
Deprecated.
-
setLoginConfig(String, String, String, String)
-
-
setPath(String)
-
-
setReloadable(boolean)
-
-
setReloadable(String)
-
-
setRequestSecurityProvider(RequestSecurityProvider)
-
Deprecated.
-
setServletLoader(ServletLoader)
-
-
setSessionManager(SessionManager)
-
-
setSessionTimeOut(int)
-
-
setWARDir(File)
-
Deprecated.
-
setWorkDir(File)
-
Deprecated.
-
setWorkDirPath(String)
- Set work dir using a String property
Deprecated.
-
setWorkDirPersistent(boolean)
-
Deprecated.
-
toString()
-
Context
public Context()
getContextManager
public ContextManager getContextManager()
setContextManager
public void setContextManager(ContextManager cm)
getPath
public String getPath()
setPath
public void setPath(String path)
setDocBase
public void setDocBase(String docB)
- DocBase points to the web application files.
There is no restriction on the syntax and content of DocBase,
it's up to the various modules to interpret this and use it.
For example, to server from a war file you can use war: protocol,
and set up War interceptors.
"Basic" tomcat treats it is a file ( either absolute or relative to
the CM home ).
If docBase is relative assume it is relative to the context manager home.
getDocBase
public String getDocBase()
setReloadable
public void setReloadable(String s)
setReloadable
public void setReloadable(boolean b)
getReloadable
public boolean getReloadable()
- Should we reload servlets ?
getWelcomeFiles
public Enumeration getWelcomeFiles()
removeWelcomeFiles
public void removeWelcomeFiles()
- Note: removeWelcomeFiles() is deprecated.
It is used as a hack to allow web.xml override default
welcome files.
Tomcat will first load the "default" web.xml and then this file.
expectUserWelcomeFiles
public void expectUserWelcomeFiles()
- If any new welcome file is added, remove the old list of
welcome files and start a new one. This is used as a hack to
allow a default web.xml file to specifiy welcome files.
We should use a better mechanism!
addWelcomeFile
public void addWelcomeFile(String s)
addTaglib
public void addTaglib(String uri,
String location)
- Add a taglib declaration for this context
getTaglibLocation
public String getTaglibLocation(String uri)
getTaglibs
public Enumeration getTaglibs()
addEnvEntry
public void addEnvEntry(String name,
String type,
String value,
String description)
- Add Env-entry to this context
getEnvEntryType
public String getEnvEntryType(String name)
getEnvEntryValue
public String getEnvEntryValue(String name)
getEnvEntries
public Enumeration getEnvEntries()
getInitParameter
public String getInitParameter(String name)
setInitParameter
public void setInitParameter(String name,
String value)
- Note: setInitParameter() is deprecated.
use addInitParameter
addInitParameter
public void addInitParameter(String name,
String value)
getInitParameterNames
public Enumeration getInitParameterNames()
getAttribute
public Object getAttribute(String name)
getAttributeNames
public Enumeration getAttributeNames()
setAttribute
public void setAttribute(String name,
Object object)
removeAttribute
public void removeAttribute(String name)
getDescription
public String getDescription()
setDescription
public void setDescription(String description)
setIcon
public void setIcon(String icon)
isDistributable
public boolean isDistributable()
setDistributable
public void setDistributable(boolean isDistributable)
getSessionTimeOut
public int getSessionTimeOut()
setSessionTimeOut
public void setSessionTimeOut(int sessionTimeOut)
getMimeMap
public FileNameMap getMimeMap()
addContentType
public void addContentType(String ext,
String type)
getErrorPage
public String getErrorPage(int errorCode)
addErrorPage
public void addErrorPage(String errorType,
String value)
getErrorPage
public String getErrorPage(String errorCode)
getAuthMethod
public String getAuthMethod()
- Authentication method, if any specified
getRealmName
public String getRealmName()
- Realm to be used
getFormLoginPage
public String getFormLoginPage()
getFormErrorPage
public String getFormErrorPage()
setLoginConfig
public void setLoginConfig(String authMethod,
String realmName,
String formLoginPage,
String formErrorPage)
addServletMapping
public void addServletMapping(String path,
String servletName) throws TomcatException
- Maps a named servlet to a particular path or extension.
If the named servlet is unregistered, it will be added
and subsequently mapped.
Note that the order of resolution to handle a request is:
exact mapped servlet (eg /catalog)
prefix mapped servlets (eg /foo/bar/*)
extension mapped servlets (eg *jsp)
default servlet
addSecurityConstraint
public void addSecurityConstraint(String path[],
String methods[],
String roles[],
String transport) throws TomcatException
getContainers
public Enumeration getContainers()
getContainerLocations
public Enumeration getContainerLocations()
getContainer
public Container getContainer(String path)
removeContainer
public void removeContainer(Container ct)
getDefaultServlet
public ServletWrapper getDefaultServlet()
removeServletByName
public void removeServletByName(String servletName) throws TomcatException
- Remove the servlet with a specific name
getServletByName
public ServletWrapper getServletByName(String servletName)
addServlet
public void addServlet(ServletWrapper wrapper) throws TomcatException
- Add a servlet with the given name to the container. The
servlet will be loaded by the container's class loader
and instantiated using the given class name.
Called to add a new servlet from web.xml
getServletNames
public Enumeration getServletNames()
getSessionManager
public SessionManager getSessionManager()
setSessionManager
public void setSessionManager(SessionManager manager)
setServletLoader
public void setServletLoader(ServletLoader loader)
getServletLoader
public ServletLoader getServletLoader()
setDebug
public void setDebug(int level)
setDebug
public void setDebug(String level)
getDebug
public int getDebug()
log
public final void log(String msg)
- Internal log method
log
public void log(String msg,
Throwable t)
logServlet
public void logServlet(String msg,
Throwable t)
- User-level log method ( called from a servlet)
toString
public String toString()
- Overrides:
- toString in class Object
getRequestDispatcher
public RequestDispatcher getRequestDispatcher(String path)
getNamedDispatcher
public RequestDispatcher getNamedDispatcher(String name)
getResource
public URL getResource(String rpath) throws MalformedURLException
- Implements getResource() - use a sub-request to let interceptors do the job.
isInvokerEnabled
public boolean isInvokerEnabled()
- Note: isInvokerEnabled() is deprecated.
setInvokerEnabled
public void setInvokerEnabled(boolean isInvokerEnabled)
- Note: setInvokerEnabled() is deprecated.
isWorkDirPersistent
public boolean isWorkDirPersistent()
- Note: isWorkDirPersistent() is deprecated.
setWorkDirPersistent
public void setWorkDirPersistent(boolean b)
- Note: setWorkDirPersistent() is deprecated.
getWorkDir
public File getWorkDir()
- Note: getWorkDir() is deprecated.
setWorkDir
public void setWorkDir(File workDir)
- Note: setWorkDir() is deprecated.
setWorkDirPath
public void setWorkDirPath(String workDir)
- Note: setWorkDirPath() is deprecated.
- Set work dir using a String property
getEngineHeader
public String getEngineHeader()
- Note: getEngineHeader() is deprecated.
setEngineHeader
public void setEngineHeader(String s)
- Note: setEngineHeader() is deprecated.
setRequestSecurityProvider
public void setRequestSecurityProvider(RequestSecurityProvider rsProvider)
- Note: setRequestSecurityProvider() is deprecated.
getRequestSecurityProvider
public RequestSecurityProvider getRequestSecurityProvider()
- Note: getRequestSecurityProvider() is deprecated.
getWARDir
public File getWARDir()
- Note: getWARDir() is deprecated.
setWARDir
public void setWARDir(File f)
- Note: setWARDir() is deprecated.
isWARExpanded
public boolean isWARExpanded()
- Note: isWARExpanded() is deprecated.
setIsWARExpanded
public void setIsWARExpanded(boolean isWARExpanded)
- Note: setIsWARExpanded() is deprecated.
isWARValidated
public boolean isWARValidated()
- Note: isWARValidated() is deprecated.
setIsWARValidated
public void setIsWARValidated(boolean isWARValidated)
- Note: setIsWARValidated() is deprecated.
addContextInterceptor
public void addContextInterceptor(ContextInterceptor ci)
- Note: addContextInterceptor() is deprecated.
getContextInterceptors
public ContextInterceptor[] getContextInterceptors()
- Note: getContextInterceptors() is deprecated.
- Return the context interceptors as an array.
For performance reasons we use an array instead of
returning the vector - the interceptors will not change at
runtime and array access is faster and easier than vector
access
addRequestInterceptor
public void addRequestInterceptor(RequestInterceptor ci)
- Note: addRequestInterceptor() is deprecated.
getRequestInterceptors
public RequestInterceptor[] getRequestInterceptors()
- Note: getRequestInterceptors() is deprecated.
- Return the context interceptors as an array.
For performance reasons we use an array instead of
returning the vector - the interceptors will not change at
runtime and array access is faster and easier than vector
access
getDocumentBase
public URL getDocumentBase()
- Note: getDocumentBase() is deprecated.
- use getDocBase and URLUtil if you need it as URL
NOT USED INSIDE TOMCAT - ONLY IN OLD J2EE CONNECTORS !
setDocumentBase
public void setDocumentBase(URL s)
- Note: setDocumentBase() is deprecated.
- use setDocBase
All Packages Class Hierarchy This Package Previous Next Index