Class JcmsServletFilter

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void endFilter​(javax.servlet.ServletRequest req)
      Ends the filter invocation if processFilter(ServletRequest) had been invoked.
      protected org.jabsorb.JSONRPCBridge initJSONBridge​(javax.servlet.http.HttpSession session)
      Initialize the session JSON Bridge (if not already done) and store it under session attribute "JSONRPCBridge".
      protected boolean processFilter​(javax.servlet.ServletRequest req)
      Checks and set the servlet filter state indicating if the filter can do all its processing or if it should directly call filter chain.
      Fix a bug in WebLogic which calls filters for every forward and include.
      To use, insert the following code at the begining of your doFilter implementation :
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.servlet.Filter

        destroy, doFilter, init
    • Constructor Detail

      • JcmsServletFilter

        public JcmsServletFilter()
    • Method Detail

      • processFilter

        protected boolean processFilter​(javax.servlet.ServletRequest req)
        Checks and set the servlet filter state indicating if the filter can do all its processing or if it should directly call filter chain.
        Fix a bug in WebLogic which calls filters for every forward and include.
        To use, insert the following code at the begining of your doFilter implementation :
          if (!processFilter(req)) {
            chain.doFilter(req, res);
            return;
          }
          [...]
         
        Parameters:
        req - the current request being processed
        Returns:
        true if the filter can continue its work, false if it must directly process the filter chain and return.
      • endFilter

        protected void endFilter​(javax.servlet.ServletRequest req)
        Ends the filter invocation if processFilter(ServletRequest) had been invoked.

          if (!processFilter(req)) {
            chain.doFilter(req, res);
            return;
          }
          try {
            [...]
          } finally {
            endFilter(req);
          }
         

        This method is optional, but it must be called to allow the filter to be invoked again in the same request if a new forward is performed after filter invocation. This can happens for error processing.
        For example :

         request 
           filter 1 begin > servlet (throws NPE) > filter 1 ends
            > appserver forward to error page  >  
           filter 1 begin > error page > filter1 ends  
         
        Parameters:
        req - the current request being processed
      • initJSONBridge

        protected org.jabsorb.JSONRPCBridge initJSONBridge​(javax.servlet.http.HttpSession session)
        Initialize the session JSON Bridge (if not already done) and store it under session attribute "JSONRPCBridge".
        Parameters:
        session - the current HttpSession
        Returns:
        the instance already available or the one newly created.
        Since:
        jcms-5.7.3