public class JspCServletContext extends Object implements ServletContext
ServletContext implementation without
HTTP-specific methods.ORDERED_LIBS, TEMPDIR| Constructor and Description |
|---|
JspCServletContext(PrintWriter aLogWriter,
URL aResourceBaseURL,
ClassLoader classLoader,
boolean validate,
boolean blockExternal)
Create a new instance of this ServletContext implementation.
|
| Modifier and Type | Method and Description |
|---|---|
FilterRegistration.Dynamic |
addFilter(String filterName,
Class<? extends Filter> filterClass) |
FilterRegistration.Dynamic |
addFilter(String filterName,
Filter filter) |
FilterRegistration.Dynamic |
addFilter(String filterName,
String className) |
void |
addListener(Class<? extends EventListener> listenerClass) |
void |
addListener(String className) |
<T extends EventListener> |
addListener(T t) |
ServletRegistration.Dynamic |
addServlet(String servletName,
Class<? extends Servlet> servletClass) |
ServletRegistration.Dynamic |
addServlet(String servletName,
Servlet servlet) |
ServletRegistration.Dynamic |
addServlet(String servletName,
String className) |
<T extends Filter> |
createFilter(Class<T> c) |
<T extends EventListener> |
createListener(Class<T> c) |
<T extends Servlet> |
createServlet(Class<T> c) |
void |
declareRoles(String... roleNames) |
Object |
getAttribute(String name)
Return the specified context attribute, if any.
|
Enumeration<String> |
getAttributeNames()
Return an enumeration of context attribute names.
|
ClassLoader |
getClassLoader() |
ServletContext |
getContext(String uripath)
Return the servlet context for the specified path.
|
String |
getContextPath()
Return the context path.
|
Set<SessionTrackingMode> |
getDefaultSessionTrackingModes() |
int |
getEffectiveMajorVersion() |
int |
getEffectiveMinorVersion() |
Set<SessionTrackingMode> |
getEffectiveSessionTrackingModes() |
FilterRegistration |
getFilterRegistration(String filterName) |
Map<String,? extends FilterRegistration> |
getFilterRegistrations() |
String |
getInitParameter(String name)
Return the specified context initialization parameter.
|
Enumeration<String> |
getInitParameterNames()
Return an enumeration of the names of context initialization
parameters.
|
JspConfigDescriptor |
getJspConfigDescriptor() |
int |
getMajorVersion()
Return the Servlet API major version number.
|
String |
getMimeType(String file)
Return the MIME type for the specified filename.
|
int |
getMinorVersion()
Return the Servlet API minor version number.
|
RequestDispatcher |
getNamedDispatcher(String name)
Return a request dispatcher for the specified servlet name.
|
String |
getRealPath(String path)
Return the real path for the specified context-relative
virtual path.
|
RequestDispatcher |
getRequestDispatcher(String path)
Return a request dispatcher for the specified context-relative path.
|
URL |
getResource(String path)
Return a URL object of a resource that is mapped to the
specified context-relative path.
|
InputStream |
getResourceAsStream(String path)
Return an InputStream allowing access to the resource at the
specified context-relative path.
|
Set<String> |
getResourcePaths(String path)
Return the set of resource paths for the "directory" at the
specified context path.
|
String |
getServerInfo()
Return descriptive information about this server.
|
Servlet |
getServlet(String name)
Deprecated.
This method has been deprecated with no replacement
|
String |
getServletContextName()
Return the name of this servlet context.
|
Enumeration<String> |
getServletNames()
Deprecated.
This method has been deprecated with no replacement
|
ServletRegistration |
getServletRegistration(String servletName) |
Map<String,? extends ServletRegistration> |
getServletRegistrations() |
Enumeration<Servlet> |
getServlets()
Deprecated.
This method has been deprecated with no replacement
|
SessionCookieConfig |
getSessionCookieConfig() |
String |
getVirtualServerName() |
void |
log(Exception exception,
String message)
Deprecated.
Use log(String,Throwable) instead
|
void |
log(String message)
Log the specified message.
|
void |
log(String message,
Throwable exception)
Log the specified message and exception.
|
void |
removeAttribute(String name)
Remove the specified context attribute.
|
void |
setAttribute(String name,
Object value)
Set or replace the specified context attribute.
|
boolean |
setInitParameter(String name,
String value) |
void |
setSessionTrackingModes(Set<SessionTrackingMode> sessionTrackingModes) |
public JspCServletContext(PrintWriter aLogWriter, URL aResourceBaseURL, ClassLoader classLoader, boolean validate, boolean blockExternal) throws JasperException
aLogWriter - PrintWriter which is used for log() callsaResourceBaseURL - Resource base URLclassLoader - Class loader for this ServletContextvalidate - Should a validating parser be used to parse web.xml?blockExternal - Should external entities be blocked when parsing
web.xml?JasperException - An error occurred building the merged web.xmlpublic Object getAttribute(String name)
getAttribute in interface ServletContextname - Name of the requested attributepublic Enumeration<String> getAttributeNames()
getAttributeNames in interface ServletContextpublic ServletContext getContext(String uripath)
getContext in interface ServletContexturipath - Server-relative path starting with '/'public String getContextPath()
getContextPath in interface ServletContextpublic String getInitParameter(String name)
getInitParameter in interface ServletContextname - Name of the requested parameterpublic Enumeration<String> getInitParameterNames()
getInitParameterNames in interface ServletContextpublic int getMajorVersion()
getMajorVersion in interface ServletContextpublic String getMimeType(String file)
getMimeType in interface ServletContextfile - Filename whose MIME type is requestedpublic int getMinorVersion()
getMinorVersion in interface ServletContextpublic RequestDispatcher getNamedDispatcher(String name)
getNamedDispatcher in interface ServletContextname - Name of the requested servletpublic String getRealPath(String path)
getRealPath in interface ServletContextpath - The context-relative virtual path to resolvepublic RequestDispatcher getRequestDispatcher(String path)
getRequestDispatcher in interface ServletContextpath - Context-relative path for which to acquire a dispatcherpublic URL getResource(String path) throws MalformedURLException
getResource in interface ServletContextpath - Context-relative path of the desired resourceMalformedURLException - if the resource path is
not properly formedpublic InputStream getResourceAsStream(String path)
getResourceAsStream in interface ServletContextpath - Context-relative path of the desired resourcepublic Set<String> getResourcePaths(String path)
getResourcePaths in interface ServletContextpath - Context-relative base pathpublic String getServerInfo()
getServerInfo in interface ServletContext@Deprecated public Servlet getServlet(String name) throws ServletException
getServlet in interface ServletContextname - Name of the requested servletServletExceptionpublic String getServletContextName()
getServletContextName in interface ServletContext@Deprecated public Enumeration<String> getServletNames()
getServletNames in interface ServletContext@Deprecated public Enumeration<Servlet> getServlets()
getServlets in interface ServletContextpublic void log(String message)
log in interface ServletContextmessage - The message to be logged@Deprecated public void log(Exception exception, String message)
log in interface ServletContextexception - The exception to be loggedmessage - The message to be loggedpublic void log(String message, Throwable exception)
log in interface ServletContextmessage - The message to be loggedexception - The exception to be loggedpublic void removeAttribute(String name)
removeAttribute in interface ServletContextname - Name of the attribute to removepublic void setAttribute(String name, Object value)
setAttribute in interface ServletContextname - Name of the context attribute to setvalue - Corresponding attribute valuepublic FilterRegistration.Dynamic addFilter(String filterName, String className)
addFilter in interface ServletContextpublic ServletRegistration.Dynamic addServlet(String servletName, String className)
addServlet in interface ServletContextpublic Set<SessionTrackingMode> getDefaultSessionTrackingModes()
getDefaultSessionTrackingModes in interface ServletContextpublic Set<SessionTrackingMode> getEffectiveSessionTrackingModes()
getEffectiveSessionTrackingModes in interface ServletContextpublic SessionCookieConfig getSessionCookieConfig()
getSessionCookieConfig in interface ServletContextpublic void setSessionTrackingModes(Set<SessionTrackingMode> sessionTrackingModes)
setSessionTrackingModes in interface ServletContextpublic FilterRegistration.Dynamic addFilter(String filterName, Filter filter)
addFilter in interface ServletContextpublic FilterRegistration.Dynamic addFilter(String filterName, Class<? extends Filter> filterClass)
addFilter in interface ServletContextpublic ServletRegistration.Dynamic addServlet(String servletName, Servlet servlet)
addServlet in interface ServletContextpublic ServletRegistration.Dynamic addServlet(String servletName, Class<? extends Servlet> servletClass)
addServlet in interface ServletContextpublic <T extends Filter> T createFilter(Class<T> c) throws ServletException
createFilter in interface ServletContextServletExceptionpublic <T extends Servlet> T createServlet(Class<T> c) throws ServletException
createServlet in interface ServletContextServletExceptionpublic FilterRegistration getFilterRegistration(String filterName)
getFilterRegistration in interface ServletContextpublic ServletRegistration getServletRegistration(String servletName)
getServletRegistration in interface ServletContextpublic boolean setInitParameter(String name, String value)
setInitParameter in interface ServletContextpublic void addListener(Class<? extends EventListener> listenerClass)
addListener in interface ServletContextpublic void addListener(String className)
addListener in interface ServletContextpublic <T extends EventListener> void addListener(T t)
addListener in interface ServletContextpublic <T extends EventListener> T createListener(Class<T> c) throws ServletException
createListener in interface ServletContextServletExceptionpublic void declareRoles(String... roleNames)
declareRoles in interface ServletContextpublic ClassLoader getClassLoader()
getClassLoader in interface ServletContextpublic int getEffectiveMajorVersion()
getEffectiveMajorVersion in interface ServletContextpublic int getEffectiveMinorVersion()
getEffectiveMinorVersion in interface ServletContextpublic Map<String,? extends FilterRegistration> getFilterRegistrations()
getFilterRegistrations in interface ServletContextpublic JspConfigDescriptor getJspConfigDescriptor()
getJspConfigDescriptor in interface ServletContextpublic Map<String,? extends ServletRegistration> getServletRegistrations()
getServletRegistrations in interface ServletContextpublic String getVirtualServerName()
getVirtualServerName in interface ServletContextCopyright © 2014–2021. All rights reserved.