Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.jasper.servlet.JspCServletContext
public class JspCServletContext
extends java.lang.Object
implements ServletContext
ServletContext
implementation without
HTTP-specific methods.
Field Summary | |
protected Hashtable |
|
protected PrintWriter |
|
protected URL |
|
Constructor Summary | |
|
Method Summary | |
Object |
|
Enumeration |
|
ServletContext |
|
String |
|
Enumeration |
|
int |
|
String |
|
int |
|
RequestDispatcher |
|
String |
|
RequestDispatcher |
|
URL |
|
InputStream |
|
Set |
|
String |
|
Servlet |
|
String |
|
Enumeration |
|
Enumeration |
|
void |
|
void |
|
void |
|
void |
|
void |
|
protected Hashtable myAttributes
Servlet context attributes.
protected PrintWriter myLogWriter
The log writer we will write log messages to.
protected URL myResourceBaseURL
The base URL (document root) for this context.
public JspCServletContext(PrintWriter aLogWriter, URL aResourceBaseURL)
Create a new instance of this ServletContext implementation.
- Parameters:
aLogWriter
- PrintWriter which is used forlog()
callsaResourceBaseURL
- Resource base URL
public Object getAttribute(String name)
Return the specified context attribute, if any.
- Parameters:
name
- Name of the requested attribute
public Enumeration getAttributeNames()
Return an enumeration of context attribute names.
public ServletContext getContext(String uripath)
Return the servlet context for the specified path.
- Parameters:
uripath
- Server-relative path starting with '/'
public String getInitParameter(String name)
Return the specified context initialization parameter.
- Parameters:
name
- Name of the requested parameter
public Enumeration getInitParameterNames()
Return an enumeration of the names of context initialization parameters.
public int getMajorVersion()
Return the Servlet API major version number.
public String getMimeType(String file)
Return the MIME type for the specified filename.
- Parameters:
file
- Filename whose MIME type is requested
public int getMinorVersion()
Return the Servlet API minor version number.
public RequestDispatcher getNamedDispatcher(String name)
Return a request dispatcher for the specified servlet name.
- Parameters:
name
- Name of the requested servlet
public String getRealPath(String path)
Return the real path for the specified context-relative virtual path.
- Parameters:
path
- The context-relative virtual path to resolve
public RequestDispatcher getRequestDispatcher(String path)
Return a request dispatcher for the specified context-relative path.
- Parameters:
path
- Context-relative path for which to acquire a dispatcher
public URL getResource(String path) throws MalformedURLException
Return a URL object of a resource that is mapped to the specified context-relative path.
- Parameters:
path
- Context-relative path of the desired resource
public InputStream getResourceAsStream(String path)
Return an InputStream allowing access to the resource at the specified context-relative path.
- Parameters:
path
- Context-relative path of the desired resource
public Set getResourcePaths(String path)
Return the set of resource paths for the "directory" at the specified context path.
- Parameters:
path
- Context-relative base path
public String getServerInfo()
Return descriptive information about this server.
public Servlet getServlet(String name) throws ServletException
Deprecated. This method has been deprecated with no replacement
Return a null reference for the specified servlet name.
- Parameters:
name
- Name of the requested servlet
public String getServletContextName()
Return the name of this servlet context.
public Enumeration getServletNames()
Deprecated. This method has been deprecated with no replacement
Return an empty enumeration of servlet names.
public Enumeration getServlets()
Deprecated. This method has been deprecated with no replacement
Return an empty enumeration of servlets.
public void log(Exception exception, String message)
Deprecated. Use log(String,Throwable) instead
Log the specified message and exception.
- Parameters:
exception
- The exception to be loggedmessage
- The message to be logged
public void log(String message)
Log the specified message.
- Parameters:
message
- The message to be logged
public void log(String message, Throwable exception)
Log the specified message and exception.
- Parameters:
message
- The message to be loggedexception
- The exception to be logged
public void removeAttribute(String name)
Remove the specified context attribute.
- Parameters:
name
- Name of the attribute to remove
public void setAttribute(String name, Object value)
Set or replace the specified context attribute.
- Parameters:
name
- Name of the context attribute to setvalue
- Corresponding attribute value