Class 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 Detail

      • XWikiContextInitializationFilter

        public XWikiContextInitializationFilter()
    • Method Detail

      • destroy

        public void destroy()
        Specified by:
        destroy in interface javax.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:
        doFilter in interface javax.servlet.Filter
        Throws:
        IOException
        javax.servlet.ServletException
      • init

        public void init​(javax.servlet.FilterConfig filterConfig)
                  throws javax.servlet.ServletException
        Specified by:
        init in interface javax.servlet.Filter
        Throws:
        javax.servlet.ServletException
      • initializeXWikiContext

        protected void initializeXWikiContext​(javax.servlet.ServletRequest request,
                                              javax.servlet.ServletResponse response)
                                       throws javax.servlet.ServletException
        Initializes the XWiki context.
        Parameters:
        request - the request being processed
        response - 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.