1 Reply Latest reply on Dec 10, 2008 1:01 AM by Rob Hills

    Issues with configuring the Ajax4Jsf Filter

    Rob Hills Newbie

      We're building an app with JBoss 4.2 + Seam 2.1 + RichFaces 3.2.2.GA. Profiling has pointed the finger at TIDY parsing as a performance bottleneck in our app so after some Documentation and Forum reading, I decided to put the following in our app's web.xml file:

      <context-param>
       <param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
       <param-value>NONE,NEKO</param-value>
       </context-param>
      
       <context-param>
       <param-name>org.ajax4jsf.xmlparser.NONE</param-name>
       <param-value>.*\.xhtml|.*\.seam</param-value>
       </context-param>
      


      The intention of this is to have no parsing of *.xhtml or *.seam files and use the NEKO parser for everything else.

      However, when I access the home page of our app (home.seam), logging includes things like this:
      2008-12-10 13:27:53,106 DEBUG [org.ajax4jsf.webapp.BaseXMLFilter] create HTML/XML parser for content type: text/html; charset=UTF-8
      2008-12-10 13:27:53,356 DEBUG [org.ajax4jsf.io.parser.FastHtmlParser] Parser reached state is StateManager.LT
      2008-12-10 13:27:53,356 DEBUG [org.ajax4jsf.io.parser.FastHtmlParser] Parser reached state is StateManager.EXCLAM
      2008-12-10 13:27:53,356 DEBUG [org.ajax4jsf.io.parser.FastHtmlParser] Parser reached state is StateManager.DOCTYPESTART
      
      ... lots more like this
      
      2008-12-10 13:27:53,497 DEBUG [org.ajax4jsf.io.parser.FastHtmlParser] Parser reached state is StateManager.LT
      2008-12-10 13:27:53,497 DEBUG [org.ajax4jsf.io.parser.FastHtmlParser] Parser reached state is StateManager.ELEMENT
      2008-12-10 13:27:53,497 DEBUG [org.ajax4jsf.webapp.BaseXMLFilter] Parsing html total time 375ms
      2008-12-10 13:27:53,497 DEBUG [org.ajax4jsf.webapp.BaseFilter] Finished request processing total time 7234ms for uri: /home.seam
      

      which suggests to me that our home page is still being parsed by the NEKO parser.

      Then I tried to turn off parsing for everything using this:

       <context-param>
       <param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
       <param-value>NONE</param-value>
       </context-param>
      
       <context-param>
       <param-name>org.ajax4jsf.xmlparser.NONE</param-name>
       <param-value>.*</param-value>
       </context-param>
      


      but I get exactly the same log output.

      I suspect that either I'm totally misunderstanding how this works, or else (less likely) something's broken.

      Note, I've posted a topic on the Seam forum: http://www.seamframework.org/Community/Ajax4jsfFilterHowToTweakItInSeam21#comment54499 which overlaps this one somewhat but covers some Seam-specific aspects. I apologise to anyone inconvenienced by any cross-posting issues.


        • 1. Re: Issues with configuring the Ajax4Jsf Filter
          Rob Hills Newbie

           

          "rhills" wrote:

          2008-12-10 13:27:53,497 DEBUG [org.ajax4jsf.io.parser.FastHtmlParser] Parser reached state is StateManager.ELEMENT
          

          which suggests to me that our home page is still being parsed by the NEKO parser.


          Actually, with a bit more research and thinking, it occurs to me that this is not using the NEKO parser at all, just the default org.ajax4jsf.io.parser.FastHtmlParser from the RichFaces packages.

          So it appears that my org.ajax4jsf.xmlparser settings are doing nothing at all.

          In the words of the famous Australian physicist, Professor Julius Sumner Miller: "Why is it so?".