|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.jserv.JServContext
This class implements the parts of the servlet that are longer-lived than a single request, ServletConfig and ServletContext.
There is one JServContext
object for each servlet,
and they are managed by JServServletManager
.
Field Summary | |
(package private) java.lang.String |
aliasName
|
private java.util.Properties |
initargs
|
(package private) Lock |
lock
|
(package private) javax.servlet.Servlet |
servlet
|
private JServServletManager |
servletMgr
|
Constructor Summary | |
JServContext(javax.servlet.Servlet servlet,
JServServletManager manager,
java.util.Properties initargs,
java.lang.String aliasName)
|
Method Summary | |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the value of the named attribute of the network service, or null if the attribute does not exist. |
java.lang.String |
getInitParameter(java.lang.String name)
Returns a string containing the value of the named initialization parameter of the servlet, or null if the parameter does not exist. |
java.util.Enumeration |
getInitParameterNames()
Returns the names of the servlet's initialization parameters as an enumeration of strings, or an empty enumeration if there are no initialization parameters. |
java.lang.String |
getMimeType(java.lang.String f)
Returns the mime type of the specified file, or null if not known. |
java.lang.String |
getRealPath(java.lang.String path)
Applies alias rules to the specified virtual path and returns the corresponding real path. |
java.lang.String |
getServerInfo()
Returns the name and version of the network service under which the servlet is running. |
javax.servlet.Servlet |
getServlet()
|
javax.servlet.Servlet |
getServlet(java.lang.String name)
Returns the servlet of the specified name, or null if not found. |
javax.servlet.ServletContext |
getServletContext()
Returns the context for the servlet. |
java.util.Enumeration |
getServletNames()
Returns an enumeration of the Servlet object names in this server. |
java.util.Enumeration |
getServlets()
Deprecated. Please use getServletNames in conjunction with getServlet |
void |
log(java.lang.Exception ex,
java.lang.String msg)
Write the stacktrace and the given message string to the servlet log file. |
void |
log(java.lang.String msg)
Writes the given message string to the servlet log file. |
void |
log(java.lang.String msg,
java.lang.Throwable t)
Write the given message string and the stacktrace to the servlet log file. |
void |
sendError(int sc,
java.lang.String msg)
|
void |
sendError(java.lang.Throwable ex)
|
Methods inherited from class java.lang.Object |
|
Field Detail |
private JServServletManager servletMgr
javax.servlet.Servlet servlet
private java.util.Properties initargs
Lock lock
java.lang.String aliasName
Constructor Detail |
public JServContext(javax.servlet.Servlet servlet, JServServletManager manager, java.util.Properties initargs, java.lang.String aliasName)
Method Detail |
public javax.servlet.ServletContext getServletContext()
public java.lang.String getInitParameter(java.lang.String name)
name
- the name of the parameter whose value is requested.public java.util.Enumeration getInitParameterNames()
public javax.servlet.Servlet getServlet(java.lang.String name) throws javax.servlet.ServletException
Note: This is a dangerous method to call for the following reasons.
name
- the name of the desired servlet.public java.util.Enumeration getServlets()
Note: This is a dangerous method to call for the following reasons.
getServletNames()
,
getServlet(java.lang.String)
public java.util.Enumeration getServletNames()
Note: This is a dangerous method to call for the following reasons.
public void log(java.lang.String msg)
msg
- the message to be writtenpublic void log(java.lang.Exception ex, java.lang.String msg)
exception
- the exception to be written.msg
- the message to be writtenpublic void log(java.lang.String msg, java.lang.Throwable t)
msg
- the message to be writtent
- the exception to be written.public java.lang.String getRealPath(java.lang.String path)
path
- the virtual path to be translated into a real pathpublic java.lang.String getMimeType(java.lang.String f)
file
- name of the file whose mime type is requiredpublic java.lang.String getServerInfo()
public java.lang.Object getAttribute(java.lang.String name)
name
- the name of the attribute whose value is requiredpublic void sendError(int sc, java.lang.String msg)
public void sendError(java.lang.Throwable ex)
public javax.servlet.Servlet getServlet()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |