|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.locomotive.loco.servlet.LocoServletContext
This class is instantiated for each servlet that the Locomotive initializes. An instance should be created when a servlet is initialized, and it is maintained throughout the life of the servlet.
Constructor Summary | |
LocoServletContext(ServletRoutingTable servlet_routing_table)
|
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.util.Enumeration |
getAttributeNames()
returns an enumeration of all the attribute names in the server. |
javax.servlet.ServletContext |
getContext(java.lang.String uri)
Returns the ServletContext for the specified uri. |
int |
getMajorVersion()
Returns the major version of the Servlet API this engine implements. |
java.lang.String |
getMimeType(java.lang.String file)
returns the mime type for a particular file. |
int |
getMinorVersion()
Returns the minor version of the Servlet API this engine implements. |
java.lang.String |
getRealPath(java.lang.String path)
Returns a String containing the real path that corresponds to a virtual path. |
javax.servlet.RequestDispatcher |
getRequestDispatcher(java.lang.String uripath)
This returns a requestDispatcher object that will allow forwarding to another servlet or handler. |
java.net.URL |
getResource(java.lang.String uri_path)
Returns a URL to the resource that is mapped to a specified path. |
java.io.InputStream |
getResourceAsStream(java.lang.String uri_path)
Returns the resource located at the named path as an InputStream object. |
java.lang.String |
getServerInfo()
Returns the following information about the current server, in the following format: |
javax.servlet.Servlet |
getServlet(java.lang.String name)
Deprecated. - too dangerous |
java.util.Enumeration |
getServletNames()
Deprecated. because it's too dangerous |
ServletRoutingTable |
getServletRoutingTable()
|
java.util.Enumeration |
getServlets()
Deprecated. because it's too dangerous |
void |
log(java.lang.Exception e,
java.lang.String msg)
Logs the message and the stack trace at log level 0 |
void |
log(java.lang.String msg)
Currently logs to the server log- log level 5 |
void |
log(java.lang.String msg,
java.lang.Throwable t)
Logs the message and the stack trace at log level 0 |
void |
removeAttribute(java.lang.String name)
Removes a server attribute. |
void |
setAttribute(java.lang.String name,
java.lang.Object o)
Sets a server attribute. |
void |
setServletRoutingTable(ServletRoutingTable servlet_routing_table)
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public LocoServletContext(ServletRoutingTable servlet_routing_table)
Method Detail |
public java.lang.Object getAttribute(java.lang.String name)
public java.util.Enumeration getAttributeNames()
public void setAttribute(java.lang.String name, java.lang.Object o)
public void removeAttribute(java.lang.String name)
public javax.servlet.ServletContext getContext(java.lang.String uri)
public int getMajorVersion()
public int getMinorVersion()
public java.lang.String getMimeType(java.lang.String file)
public java.lang.String getRealPath(java.lang.String path)
path
- a String specifying a virtual path, in the form
/dir/dir/servlet/file.extpublic java.net.URL getResource(java.lang.String uri_path) throws java.net.MalformedURLException
.war
file.
URLConnection
objects that are necessary
to access the resource.
null
if no resource is
mapped to the pathname.
.jsp
page returns the JSP source
code. Use a RequestDispatcher
instead to
include results of an execution.
java.lang.Class.getResource
, which looks up
resources based on a class loader. This method does not use
class loaders.
uri_path
- a String
specifying the path to
the resource (like "/dir/dir/file.ext")null
if there is no resource at that
pathpublic java.io.InputStream getResourceAsStream(java.lang.String uri_path)
InputStream
object.
InputStream
can be of any type
or length. The path must be specified according to the rules
given in getResource
. This method returns
null
if no resource exists atthe specified path.
getResource
method is lost when
using this method.
URLConnection
objects necessary to access the
resource.
java.lang.Class.getResourceAsStream
,
which uses a class loader. This method allows servlet
containers to make a resource available to a servlet from any
location, without using a class loader.
uri_path
- a String
specifying the path to
the resource (like "/dir/dir/file.ext")InputStream
taken from the
URLConnection to the resource, or null
if no resource exists at the specified path.public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String uripath)
uripath
- the path that denotes the Service to dispatch
the request topublic java.lang.String getServerInfo()
SYSTEM_TAG: SYSTEM_INSTANCE_TAG, Locomotive v (loco version), Servlet engine v (major version).(minor version).Here's an example:
COMPANY_X: sv_one, Locomotive v4.1.0, Servlet Engine v2.1
public void log(java.lang.String msg)
public void log(java.lang.String msg, java.lang.Throwable t)
public void log(java.lang.Exception e, java.lang.String msg)
public javax.servlet.Servlet getServlet(java.lang.String name)
public java.util.Enumeration getServletNames()
public java.util.Enumeration getServlets()
public ServletRoutingTable getServletRoutingTable()
public void setServletRoutingTable(ServletRoutingTable servlet_routing_table)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |