4 Replies Latest reply on Mar 5, 2008 2:01 AM by stevoffm

    RichFaces architecture questions...

      Hi,

      I am trying to understand the architecture of RichFaces and also read the developer guide. There are still some questions remaining und I also want to know if I got everything right...

      1. Richfaces has an own viewhandler and an own Renderkit, it relies on the jsf faces servlet as front controller. Is that correct?

      2. RichFaces viewhandler is pre chained to the facelets viewhandler. So Richfaces does some "magic" and then forwards it to the facelets viewhandler?! Is that correct?

      3. Why are components like tomahawk not affected when using richfaces? Are they rendered by richfaces or myfaces? How exactly is richfaces integrated in the renderprocess?!

      4. According to the article under https://blueprints.dev.java.net/bpcatalog/ee5/ajax/usingJSFwithAJAX.html
      Which concept is behind RichFaces? Does Richfaces use phase listeners? How is it integrated in the jsf lifecycle?

      Hope anyone can help...

      Thanks in advance...

        • 1. Re: RichFaces architecture questions...

           

          "StevoFFM" wrote:

          1. Richfaces has an own viewhandler and an own Renderkit, it relies on the jsf faces servlet as front controller. Is that correct?

          RichFaces do not use own Renderkit. Not for standard JSF, nor for any other third party components. All components uses their own renderers (ie. have the original behaver)

          "StevoFFM" wrote:

          2. RichFaces viewhandler is pre chained to the facelets viewhandler. So Richfaces does some "magic" and then forwards it to the facelets viewhandler?! Is that correct?

          Yes, Richfaces does some "magic". It puts itself in front of the view handlers chain.

          "StevoFFM" wrote:

          3. Why are components like tomahawk not affected when using richfaces? Are they rendered by richfaces or myfaces? How exactly is richfaces integrated in the renderprocess?!

          As I mentioned above, all components (including MyFaces' ones) are rendered by the original renderers. On the sixth phase (Render Respose phase) RichFaces make a traversal of the component tree, check component is required for rendering, call its own renderer and put the result into the response package.

          "StevoFFM" wrote:

          4. According to the article under https://blueprints.dev.java.net/bpcatalog/ee5/ajax/usingJSFwithAJAX.html
          Which concept is behind RichFaces? Does Richfaces use phase listeners? How is it integrated in the jsf lifecycle?

          RichFaces used to use phase listener approach some time ago, but not now. This approach does not work when we speak about complex environment that included other frameworks like Seam and/or Trinidad. Such frameworks widely use phase listeners for creating or manipulating with own contexts. So, using the phase listener approach for the Ajax rendering purpose does not guaranty that context actuality.
          In contrast, RichFaces uses viewhandler approach. Its renderView method guaranties that the context is ready.


          P.S. Those are the draft of the documents I wrote some time ago. They might be out-of-date already in some points, but still helpful for your framework exploration:
          http://docs.google.com/Doc?id=ddmtrs6k_20dkzxqk
          http://docs.google.com/Doc?id=ddmtrs6k_1cc9gsp

          • 2. Re: RichFaces architecture questions...

            Thanks alot for that Sergey, these docs helped me alot. ViewHandler approach sounds good and explains why richfaces is very compatible to standard JSF components and even third party components. A good concept in my oppinion...

            • 3. Re: RichFaces architecture questions...

              Hi,

              again I have some questions to understand the Richfaces architecture better:

              1. I would like to know when and where is AjaxContext initialized. I know that the FacesContext is created by the FacesServlet but as there is no AjaxServlet, which object is responsible for creation and when?

              2. Does AjaxContext overrides FacesContext or do they exist parallely?

              3. Where is AjaxViewRoot stored and how can I retrieve it? I did not found a method like AjaxContext.getAjaxViewRoot(). I thought it was stored in the AjaxContext object...

              I hope Sergey or sw. else that know the architecture well can help again.

              It is really important for me to understand it, thanks alot in advance!

              Cheers

              • 4. Re: RichFaces architecture questions...

                Is there any knowledge out there, that sw. wants to share?!

                It would be really helpful!

                Thanks