ServletHttpContext.
Extends HttpContext with conveniance methods for adding servlets.
Enforces a single ServletHandler per context.
addLocaleEncoding
public void addLocaleEncoding(String locale,
String encoding)
addServlet
public ServletHolder addServlet(String pathSpec,
String className)
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException
Add a servlet to the context.
Conveniance method.
If no ServletHandler is found in the context, a new one is added.
pathSpec
- The pathspec within the contextclassName
- The classname of the servlet.
addServlet
public ServletHolder addServlet(String name,
String pathSpec,
String className)
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException
Add a servlet to the context.
If no ServletHandler is found in the context, a new one is added.
name
- The name of the servlet.pathSpec
- The pathspec within the contextclassName
- The classname of the servlet.
getLocaleEncoding
public String getLocaleEncoding(Locale locale)
Get the character encoding for a locale. The full locale name is first
looked up in the map of encodings. If no encoding is found, then the
locale language is looked up.
- a
String
representing the character encoding for
the locale or null if none found.
getServletHandler
public ServletHandler getServletHandler()
Get the context ServletHandler.
Conveniance method. If no ServletHandler exists, a new one is added to
the context.
jSecurityCheck
protected boolean jSecurityCheck(String pathInContext,
HttpRequest request,
HttpResponse response)
throws IOException