5 Replies Latest reply on Feb 27, 2008 8:56 AM by viggo.navarsete

    Intercepting RichFaces processing...

    ricardomarques

      hi fellows

      I'm needing to intercept the request from richfaces, to be able to access to the page components, and then add some more according with some database information, and then continue the processing.

      What is be best approach to achieving this behavior? phase listener? servlet filter? other?

      Thanks in advance


        • 1. Re: Intercepting RichFaces processing...
          viggo.navarsete

          Do you intend to intercept each and every request and put some data onto the request based on some database information? Does it mean you will do a database query each time? It sounds expensive...

          • 2. Re: Intercepting RichFaces processing...
            ricardomarques

            yes, that's want i intent, because my purpose is to fetch the page components from some back end, the one i wan to use to test the mechanism is the database but i want later to put it on a ejb.

            • 3. Re: Intercepting RichFaces processing...
              viggo.navarsete

              so you want to build the user interface dynamically based on data from a datasource. The user interface is configured in a datasource. Hmm, perhaps it's just me, but this doesn't sound like a plan that will scale very well. Perhaps others have input to this approach?! Are you sure you want/must do it this way? What are the requirements for your application? Perhaps one of the Richfaces developers could come up with some advices here, because it doesn't sound like a good plan to me..

              • 4. Re: Intercepting RichFaces processing...
                ricardomarques

                well.. this is just a small portal project for learning purposes, but like i said, i want that later the components come from EJB processing, database is just for now for testing...

                Either way can you through another way of creating dynamic components?

                • 5. Re: Intercepting RichFaces processing...
                  viggo.navarsete

                  well, I can understand that you want to get your data to show in your GUI from a database/EJB, but to store the JSF components in a database/EJB seems like an odd way of doing it. Wouldn't it be better to have a backing bean fetching data for you, and have a jsf/xhtml page that is rendered based on the data the backing bean can provide for you?!