Package com.xpn.xwiki.web
Class XWikiContextInitializationFilter
- java.lang.Object
-
- com.xpn.xwiki.web.XWikiContextInitializationFilter
-
- All Implemented Interfaces:
javax.servlet.Filter
public class XWikiContextInitializationFilter extends Object implements javax.servlet.Filter
This filter can be used to initialize the XWiki context before processing a request.- Since:
- 13.4RC1
- Version:
- $Id: 0070b2bfd5fee385eefdb338f96d7182b58d946a $
-
-
Constructor Summary
Constructors Constructor Description XWikiContextInitializationFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcleanupComponents()We must ensure we clean the ThreadLocal variables located in the Container and Execution components as otherwise we will have a potential memory leak.voiddestroy()voiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)voidinit(javax.servlet.FilterConfig filterConfig)protected voidinitializeContainerComponent(XWikiContext context)protected voidinitializeXWikiContext(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)Initializes the XWiki context.
-
-
-
Method Detail
-
destroy
public void destroy()
- Specified by:
destroyin interfacejavax.servlet.Filter
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException- Specified by:
doFilterin interfacejavax.servlet.Filter- Throws:
IOExceptionjavax.servlet.ServletException
-
init
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException- Specified by:
initin interfacejavax.servlet.Filter- Throws:
javax.servlet.ServletException
-
initializeXWikiContext
protected void initializeXWikiContext(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws javax.servlet.ServletExceptionInitializes the XWiki context.- Parameters:
request- the request being processedresponse- the response- Throws:
javax.servlet.ServletException- if the initialization fails
-
initializeContainerComponent
protected void initializeContainerComponent(XWikiContext context) throws javax.servlet.ServletException
- Parameters:
context- the XWiki context- Throws:
javax.servlet.ServletException- if the container component initialization fails
-
cleanupComponents
protected void cleanupComponents()
We must ensure we clean the ThreadLocal variables located in the Container and Execution components as otherwise we will have a potential memory leak.
-
-