|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mortbay.util.Container
org.mortbay.http.HttpContext
org.mortbay.jetty.servlet.ServletHttpContext
ServletHttpContext. Extends HttpContext with conveniance methods for adding servlets. Enforces a single ServletHandler per context.
Field Summary |
Fields inherited from class org.mortbay.http.HttpContext |
__ErrorHandler, __fileClassPathAttr |
Constructor Summary | |
ServletHttpContext()
Constructor. |
Method Summary | |
void |
addLocaleEncoding(java.lang.String locale,
java.lang.String encoding)
|
ServletHolder |
addServlet(java.lang.String pathSpec,
java.lang.String className)
Add a servlet to the context. |
ServletHolder |
addServlet(java.lang.String name,
java.lang.String pathSpec,
java.lang.String className)
Add a servlet to the context. |
boolean |
checkSecurityConstraints(java.lang.String pathInContext,
HttpRequest request,
HttpResponse response)
|
void |
destroy()
Destroy a context. |
java.lang.Object |
enterContextScope(HttpRequest request,
HttpResponse response)
Enter the context scope. |
java.lang.String |
getLocaleEncoding(java.util.Locale locale)
Get the character encoding for a locale. |
ServletContext |
getServletContext()
|
ServletHandler |
getServletHandler()
Get the context ServletHandler. |
void |
sendError(HttpResponse response,
int code,
java.lang.String msg)
Send an error response. |
java.lang.String |
toString()
|
Methods inherited from class org.mortbay.util.Container |
addEventListener, getComponents, isStarted, removeEventListener, start, stop |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.mortbay.util.LifeCycle |
isStarted, start, stop |
Methods inherited from interface org.mortbay.util.EventProvider |
addEventListener, removeEventListener |
Constructor Detail |
public ServletHttpContext()
Method Detail |
public ServletContext getServletContext()
public ServletHandler getServletHandler()
public ServletHolder addServlet(java.lang.String pathSpec, java.lang.String className) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
pathSpec
- The pathspec within the contextclassName
- The classname of the servlet.
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
public ServletHolder addServlet(java.lang.String name, java.lang.String pathSpec, java.lang.String className) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
name
- The name of the servlet.pathSpec
- The pathspec within the contextclassName
- The classname of the servlet.
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
public boolean checkSecurityConstraints(java.lang.String pathInContext, HttpRequest request, HttpResponse response) throws HttpException, java.io.IOException
checkSecurityConstraints
in class HttpContext
HttpException
java.io.IOException
public void addLocaleEncoding(java.lang.String locale, java.lang.String encoding)
public java.lang.String getLocaleEncoding(java.util.Locale locale)
locale
- a Locale
value
String
representing the character encoding for
the locale or null if none found.public java.lang.String toString()
toString
in class HttpContext
public void sendError(HttpResponse response, int code, java.lang.String msg) throws java.io.IOException
HttpContext
sendError
in class HttpContext
response
- the response to sendcode
- The error codemsg
- The message for the error or null for the default
java.io.IOException
- Problem sending response.public void destroy()
HttpContext
destroy
in class HttpContext
public java.lang.Object enterContextScope(HttpRequest request, HttpResponse response)
HttpContext
enterContextScope
in class HttpContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |