docs: public static void doFilter(PortletRequest request, PortletResponse response, FilterChain chain)
              throws IOException, PortletException {
          
          final Object phase = request.getAttribute(PortletRequest.LIFECYCLE_PHASE);
  
          if (PortletRequest.ACTION_PHASE.equals(phase)) {
              chain.doFilter((ActionRequest) request, (ActionResponse) response);
          }
          else if (PortletRequest.EVENT_PHASE.equals(phase)) {
              chain.doFilter((EventRequest) request, (EventResponse) response);
          }
          else if (PortletRequest.RENDER_PHASE.equals(phase)) {
              chain.doFilter((RenderRequest) request, (RenderResponse) response);
          }
          else if (PortletRequest.RESOURCE_PHASE.equals(phase)) {
              chain.doFilter((ResourceRequest) request, (ResourceResponse) response);
          }
          else {
              throw new IllegalArgumentException("Unknown Portlet Lifecycle Phase: " + phase);
          }
      }