org.apache.cocoon.environment
Interface Context

All Superinterfaces:
ServletContext

public interface Context
extends ServletContext

Defines an interface to provide context information. Since 2.2 this interface extends the ServletContext interface.

Version:
$Id: Context.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Method Summary
 Object getAttribute(String name)
           
 Enumeration getAttributeNames()
           
 Map getAttributes()
          Utility method for getting a Map view of the context attributes.
 String getInitParameter(String name)
           
 String getMimeType(String file)
           
 String getRealPath(String path)
           
 URL getResource(String path)
           
 InputStream getResourceAsStream(String path)
           
 void removeAttribute(String name)
           
 void setAttribute(String name, Object value)
           
 
Methods inherited from interface javax.servlet.ServletContext
getContext, getInitParameterNames, getMajorVersion, getMinorVersion, getNamedDispatcher, getRequestDispatcher, getResourcePaths, getServerInfo, getServlet, getServletContextName, getServletNames, getServlets, log, log, log
 

Method Detail

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface ServletContext

setAttribute

public void setAttribute(String name,
                         Object value)
Specified by:
setAttribute in interface ServletContext

removeAttribute

public void removeAttribute(String name)
Specified by:
removeAttribute in interface ServletContext

getAttributeNames

public Enumeration getAttributeNames()
Specified by:
getAttributeNames in interface ServletContext

getAttributes

public Map getAttributes()
Utility method for getting a Map view of the context attributes. Returns a Map with context attributes.

Returns:
a Map containing the context attributes.
Since:
2.2

getResource

public URL getResource(String path)
                throws MalformedURLException
Specified by:
getResource in interface ServletContext
Throws:
MalformedURLException

getRealPath

public String getRealPath(String path)
Specified by:
getRealPath in interface ServletContext

getMimeType

public String getMimeType(String file)
Specified by:
getMimeType in interface ServletContext

getInitParameter

public String getInitParameter(String name)
Specified by:
getInitParameter in interface ServletContext

getResourceAsStream

public InputStream getResourceAsStream(String path)
Specified by:
getResourceAsStream in interface ServletContext


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.