public class ServletContextImpl extends Object implements javax.servlet.ServletContext
Constructor and Description |
---|
ServletContextImpl(ServletContainer servletContainer, Deployment deployment) |
Modifier and Type | Method and Description |
---|---|
javax.servlet.FilterRegistration.Dynamic | addFilter(String filterName, Class<? extends javax.servlet.Filter> filterClass) |
javax.servlet.FilterRegistration.Dynamic | addFilter(String filterName, javax.servlet.Filter filter) |
javax.servlet.FilterRegistration.Dynamic | addFilter(String filterName, String className) |
javax.servlet.ServletRegistration.Dynamic | addJspFile(String servletName, String jspFile) |
void | addListener(Class<? extends EventListener> listenerClass) |
void | addListener(String className) |
<T extends EventListener> | addListener(T t) |
javax.servlet.ServletRegistration.Dynamic | addServlet(String servletName, Class<? extends javax.servlet.Servlet> servletClass) |
javax.servlet.ServletRegistration.Dynamic | addServlet(String servletName, javax.servlet.Servlet servlet) |
javax.servlet.ServletRegistration.Dynamic | addServlet(String servletName, String className) |
javax.servlet.ServletRegistration.Dynamic | addServlet(String servletName, String className, List<HandlerWrapper> wrappers) |
<T extends javax.servlet.Filter> | createFilter(Class<T> clazz) |
<T extends EventListener> | createListener(Class<T> clazz) |
<T extends javax.servlet.Servlet> | createServlet(Class<T> clazz) |
void | declareRoles(String... roleNames) |
void | destroy() |
Object | getAttribute(String name) |
Enumeration<String> | getAttributeNames() |
ClassLoader | getClassLoader() |
javax.servlet.ServletContext | getContext(String uripath) |
String | getContextPath() |
Set<javax.servlet.SessionTrackingMode> | getDefaultSessionTrackingModes() |
Deployment | getDeployment() |
int | getEffectiveMajorVersion() |
int | getEffectiveMinorVersion() |
Set<javax.servlet.SessionTrackingMode> | getEffectiveSessionTrackingModes() |
javax.servlet.FilterRegistration | getFilterRegistration(String filterName) |
Map<String,? extends javax.servlet.FilterRegistration> | getFilterRegistrations() |
String | getInitParameter(String name) |
Enumeration<String> | getInitParameterNames() |
javax.servlet.descriptor.JspConfigDescriptor | getJspConfigDescriptor() |
int | getMajorVersion() |
String | getMimeType(String file) |
int | getMinorVersion() |
javax.servlet.RequestDispatcher | getNamedDispatcher(String name) |
String | getRealPath(String path) |
String | getRequestCharacterEncoding() |
javax.servlet.RequestDispatcher | getRequestDispatcher(String path) |
URL | getResource(String path) |
InputStream | getResourceAsStream(String path) |
Set<String> | getResourcePaths(String path) |
String | getResponseCharacterEncoding() |
String | getServerInfo() |
javax.servlet.Servlet | getServlet(String name) |
String | getServletContextName() |
Enumeration<String> | getServletNames() |
javax.servlet.ServletRegistration | getServletRegistration(String servletName) |
Map<String,? extends javax.servlet.ServletRegistration> | getServletRegistrations() |
Enumeration<javax.servlet.Servlet> | getServlets() |
HttpSessionImpl | getSession(HttpServerExchange exchange, boolean create) Gets the session |
HttpSessionImpl | getSession(ServletContextImpl originalServletContext, HttpServerExchange exchange, boolean create) |
HttpSessionImpl | getSession(String sessionId) Gets the session with the specified ID if it exists |
SessionConfig | getSessionConfig() |
SessionCookieConfigImpl | getSessionCookieConfig() |
int | getSessionTimeout() |
String | getVirtualServerName() |
void | initDone() |
void | log(Exception exception, String msg) |
void | log(String msg) |
void | log(String message, Throwable throwable) |
void | removeAttribute(String name) |
void | setAttribute(String name, Object object) |
void | setDefaultSessionTrackingModes(HashSet<javax.servlet.SessionTrackingMode> sessionTrackingModes) |
boolean | setInitParameter(String name, String value) |
void | setRequestCharacterEncoding(String encoding) |
void | setResponseCharacterEncoding(String encoding) |
void | setSessionTimeout(int sessionTimeout) |
void | setSessionTrackingModes(Set<javax.servlet.SessionTrackingMode> sessionTrackingModes) |
void | updateSessionAccessTime(HttpServerExchange exchange) |
public ServletContextImpl(ServletContainer servletContainer, Deployment deployment)
public void initDone()
public String getContextPath()
getContextPath
in interface javax.servlet.ServletContext
public javax.servlet.ServletContext getContext(String uripath)
getContext
in interface javax.servlet.ServletContext
public int getMajorVersion()
getMajorVersion
in interface javax.servlet.ServletContext
public int getMinorVersion()
getMinorVersion
in interface javax.servlet.ServletContext
public int getEffectiveMajorVersion()
getEffectiveMajorVersion
in interface javax.servlet.ServletContext
public int getEffectiveMinorVersion()
getEffectiveMinorVersion
in interface javax.servlet.ServletContext
public String getMimeType(String file)
getMimeType
in interface javax.servlet.ServletContext
public Set<String> getResourcePaths(String path)
getResourcePaths
in interface javax.servlet.ServletContext
public URL getResource(String path) throws MalformedURLException
getResource
in interface javax.servlet.ServletContext
MalformedURLException
public InputStream getResourceAsStream(String path)
getResourceAsStream
in interface javax.servlet.ServletContext
public javax.servlet.RequestDispatcher getRequestDispatcher(String path)
getRequestDispatcher
in interface javax.servlet.ServletContext
public javax.servlet.RequestDispatcher getNamedDispatcher(String name)
getNamedDispatcher
in interface javax.servlet.ServletContext
public javax.servlet.Servlet getServlet(String name) throws javax.servlet.ServletException
getServlet
in interface javax.servlet.ServletContext
javax.servlet.ServletException
public Enumeration<javax.servlet.Servlet> getServlets()
getServlets
in interface javax.servlet.ServletContext
public Enumeration<String> getServletNames()
getServletNames
in interface javax.servlet.ServletContext
public void log(String msg)
log
in interface javax.servlet.ServletContext
public void log(Exception exception, String msg)
log
in interface javax.servlet.ServletContext
public void log(String message, Throwable throwable)
log
in interface javax.servlet.ServletContext
public String getRealPath(String path)
getRealPath
in interface javax.servlet.ServletContext
public String getServerInfo()
getServerInfo
in interface javax.servlet.ServletContext
public String getInitParameter(String name)
getInitParameter
in interface javax.servlet.ServletContext
public Enumeration<String> getInitParameterNames()
getInitParameterNames
in interface javax.servlet.ServletContext
public boolean setInitParameter(String name, String value)
setInitParameter
in interface javax.servlet.ServletContext
public Object getAttribute(String name)
getAttribute
in interface javax.servlet.ServletContext
public Enumeration<String> getAttributeNames()
getAttributeNames
in interface javax.servlet.ServletContext
public void setAttribute(String name, Object object)
setAttribute
in interface javax.servlet.ServletContext
public void removeAttribute(String name)
removeAttribute
in interface javax.servlet.ServletContext
public String getServletContextName()
getServletContextName
in interface javax.servlet.ServletContext
public javax.servlet.ServletRegistration.Dynamic addServlet(String servletName, String className)
addServlet
in interface javax.servlet.ServletContext
public javax.servlet.ServletRegistration.Dynamic addServlet(String servletName, String className, List<HandlerWrapper> wrappers)
public javax.servlet.ServletRegistration.Dynamic addServlet(String servletName, javax.servlet.Servlet servlet)
addServlet
in interface javax.servlet.ServletContext
public javax.servlet.ServletRegistration.Dynamic addServlet(String servletName, Class<? extends javax.servlet.Servlet> servletClass)
addServlet
in interface javax.servlet.ServletContext
public <T extends javax.servlet.Servlet> T createServlet(Class<T> clazz) throws javax.servlet.ServletException
createServlet
in interface javax.servlet.ServletContext
javax.servlet.ServletException
public javax.servlet.ServletRegistration getServletRegistration(String servletName)
getServletRegistration
in interface javax.servlet.ServletContext
public Map<String,? extends javax.servlet.ServletRegistration> getServletRegistrations()
getServletRegistrations
in interface javax.servlet.ServletContext
public javax.servlet.FilterRegistration.Dynamic addFilter(String filterName, String className)
addFilter
in interface javax.servlet.ServletContext
public javax.servlet.FilterRegistration.Dynamic addFilter(String filterName, javax.servlet.Filter filter)
addFilter
in interface javax.servlet.ServletContext
public javax.servlet.FilterRegistration.Dynamic addFilter(String filterName, Class<? extends javax.servlet.Filter> filterClass)
addFilter
in interface javax.servlet.ServletContext
public <T extends javax.servlet.Filter> T createFilter(Class<T> clazz) throws javax.servlet.ServletException
createFilter
in interface javax.servlet.ServletContext
javax.servlet.ServletException
public javax.servlet.FilterRegistration getFilterRegistration(String filterName)
getFilterRegistration
in interface javax.servlet.ServletContext
public Map<String,? extends javax.servlet.FilterRegistration> getFilterRegistrations()
getFilterRegistrations
in interface javax.servlet.ServletContext
public SessionCookieConfigImpl getSessionCookieConfig()
getSessionCookieConfig
in interface javax.servlet.ServletContext
public void setSessionTrackingModes(Set<javax.servlet.SessionTrackingMode> sessionTrackingModes)
setSessionTrackingModes
in interface javax.servlet.ServletContext
public Set<javax.servlet.SessionTrackingMode> getDefaultSessionTrackingModes()
getDefaultSessionTrackingModes
in interface javax.servlet.ServletContext
public Set<javax.servlet.SessionTrackingMode> getEffectiveSessionTrackingModes()
getEffectiveSessionTrackingModes
in interface javax.servlet.ServletContext
public void addListener(String className)
addListener
in interface javax.servlet.ServletContext
public <T extends EventListener> void addListener(T t)
addListener
in interface javax.servlet.ServletContext
public void addListener(Class<? extends EventListener> listenerClass)
addListener
in interface javax.servlet.ServletContext
public <T extends EventListener> T createListener(Class<T> clazz) throws javax.servlet.ServletException
createListener
in interface javax.servlet.ServletContext
javax.servlet.ServletException
public javax.servlet.descriptor.JspConfigDescriptor getJspConfigDescriptor()
getJspConfigDescriptor
in interface javax.servlet.ServletContext
public ClassLoader getClassLoader()
getClassLoader
in interface javax.servlet.ServletContext
public void declareRoles(String... roleNames)
declareRoles
in interface javax.servlet.ServletContext
public javax.servlet.ServletRegistration.Dynamic addJspFile(String servletName, String jspFile)
addJspFile
in interface javax.servlet.ServletContext
public int getSessionTimeout()
getSessionTimeout
in interface javax.servlet.ServletContext
public void setSessionTimeout(int sessionTimeout)
setSessionTimeout
in interface javax.servlet.ServletContext
public String getRequestCharacterEncoding()
getRequestCharacterEncoding
in interface javax.servlet.ServletContext
public void setRequestCharacterEncoding(String encoding)
setRequestCharacterEncoding
in interface javax.servlet.ServletContext
public String getResponseCharacterEncoding()
getResponseCharacterEncoding
in interface javax.servlet.ServletContext
public void setResponseCharacterEncoding(String encoding)
setResponseCharacterEncoding
in interface javax.servlet.ServletContext
public String getVirtualServerName()
getVirtualServerName
in interface javax.servlet.ServletContext
public HttpSessionImpl getSession(String sessionId)
sessionId
- The session IDpublic HttpSessionImpl getSession(ServletContextImpl originalServletContext, HttpServerExchange exchange, boolean create)
public HttpSessionImpl getSession(HttpServerExchange exchange, boolean create)
create
- public void updateSessionAccessTime(HttpServerExchange exchange)
public Deployment getDeployment()
public SessionConfig getSessionConfig()
public void destroy()
public void setDefaultSessionTrackingModes(HashSet<javax.servlet.SessionTrackingMode> sessionTrackingModes)
Copyright © 2020 JBoss by Red Hat. All rights reserved.