4 Replies Latest reply on Aug 9, 2007 12:37 PM by ishabalov

    Ajax4jsf filter always parses the response, even for non-AJA

    kjohnston

      I have a page that was using a4j to return a very large response. I noticed that much of the time was being spent in the XML parser in the a4j filter, so I decided to make it into a normal JSF page instead.

      The XML parser was still invoked! Looking at the code, it looks like the xml parser is invoked even if the request is not an AJAX request.

      I would like to avoid building ajax4jsf just to fix this bug - any chance this could be fixed in a patch?

      In org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.java:

      setupRequestEncoding(httpServletRequest);
       // check ajax request parameter
       // TODO - check for JSF page.
       if (true) {
       if (log.isDebugEnabled()) {
       log.debug(Messages
       .getMessage(Messages.FILTER_XML_OUTPUT));
       }
      
       // Execute the rest of the filter chain, including the
       // JSP
       xmlFilter.doXmlFilter(chain, httpServletRequest,
       httpServletResponse);
       } else {
       // normal request, execute chain ...
       if (log.isDebugEnabled()) {
       log.debug(Messages
       .getMessage(Messages.FILTER_NO_XML_CHAIN));
       }
       chain.doFilter(request, response);
      
       }
       }