public class ServletFilter extends Object implements javax.servlet.Filter
This filter needs to be setup in each application's web.xml
descriptor like:
<filter> <filter-name>jDTAUS Integration Filter</filter-name> <filter-class>org.jdtaus.core.container.ri.servlet.ServletFilter</filter-class> </filter>
init(FilterConfig)
Constructor and Description |
---|
ServletFilter()
Creates a new
ServletFilter instance. |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
void |
doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse rsp,
javax.servlet.FilterChain chain)
Attaches the request's
HttpSession with corresponding
ServletContext to the current thread of execution. |
static javax.servlet.http.HttpSession |
getHttpSession()
Gets the thread local HTTP session.
|
static Locale |
getLocale()
Gets the thread local locale.
|
static javax.servlet.ServletContext |
getServletContext()
Gets the thread local servlet context.
|
void |
init(javax.servlet.FilterConfig filterConfig)
Initializes the filter by configuring
ContainerFactory ,
ModelFactory and ContextFactory to use the
ServletContextFactories implementation. |
public ServletFilter()
ServletFilter
instance.public void destroy()
destroy
in interface javax.servlet.Filter
public void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse rsp, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
HttpSession
with corresponding
ServletContext
to the current thread of execution.doFilter
in interface javax.servlet.Filter
IOException
javax.servlet.ServletException
getServletContext()
,
getHttpSession()
public static javax.servlet.http.HttpSession getHttpSession()
SessionLostException
- if no session is bound to the current
thread of execution or if the requesting ServletRequest
is not
an instance of HttpServletRequest
.public static Locale getLocale()
public static javax.servlet.ServletContext getServletContext()
ContextLostException
- if no servlet context is bound to the
current thread of execution.public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
ContainerFactory
,
ModelFactory
and ContextFactory
to use the
ServletContextFactories
implementation.init
in interface javax.servlet.Filter
javax.servlet.ServletException
ServletContextFactories
Copyright © 2005–2014 jDTAUS. All rights reserved.