10 Replies Latest reply on Jul 9, 2007 6:42 AM by antoine_h

    RichFaces : sample for ajax jsf portlet provided

    antoine_h

      RichFaces has provided a sample application that use RichFaces Ajax and JSF nice components in a JBoss Portal Portlet.

      see : http://jira.jboss.com/jira/browse/RF-186?page=all

      There is :
      - "a custom portlet driver as a result of merge MyFacesGenericPortlet and AJAXFacesPortlet classes. This was necessary because the Lifecycle and other myfaces classes uses some information that must be present in the request or session scopes. (RudderPortletDriver)"
      - "A custom PortletViewHandler. We need to add the MyFaces ViewID to the ActionURL (Line 68)"
      - overwrite in the classes directory of the Web application the org.richfaces.renderkit.ModalPanelRendererBase.java, because in the original file there was a sentence that cast the Context of the ExternalContext to a ServletContext that throws a ClassCastException.

      and also : note :
      One aspect related to the JBoss configuration. When the richfaces pages are so big (a lot of components, includes, popups etc.) the header of the response is greater that the size managed by default, causing a ArrayIndexOutOfBounds Exception y the Coyote Writer. Well this can be solved changing the value of the maxHttpHeaderSize in the Coyote Connector configuration (server/default/deploy/jbossweb-tomcat55.sar/server.xml).

        • 1. Re: RichFaces : sample for ajax jsf portlet provided
          theute

          Did you try with 2.6.GA ?

          • 2. Re: RichFaces : sample for ajax jsf portlet provided
            antoine_h

            nop...
            The guy who provided it used RC3

            I will, but need first to finish upgrade my portal from 2.4.1 to 2.6RC3, then reinstall with 2.6 GA....
            I am looking forward to use RichFaces in the portal, but have many things to do else (user management stuf, ejb3... plus a new prestation for a company who want to start a portal...).
            I can say it will be before the end of july.

            I posted so people can have the info and may start using... but can't do some try and test action...

            • 3. Re: RichFaces : sample for ajax jsf portlet provided
              chuaky

              hi Antoine,

              I try to deploy richfacesTest-app.ear on my server but it doesn't work. There was no output when the link on the navigation bar was clicked. My setting are:

              - Jboss AS 4.0.5
              - Seam 1.2.1
              - Portal 2.4.1SP1

              What do i need to change to make it work?

              I have been trying to use ajax4jsf and richfaces in portlet environment for long time but cannot get it to work.

              Very sad :(
              Thanks.

              • 4. Re: RichFaces : sample for ajax jsf portlet provided
                antoine_h

                ho ho ! are you trying with JBP 2.4.1 ?
                This version is not able for using any Ajax feature (for RichFaces or any other thing). And it is not easy to have work with Ajax, for what I saw.

                Ajax in portlet is a new feature of JBP 2.6.0.
                That is why, with this version, using RichFaces becomes possible.
                See the RichFaces Jira indicated above in previous post of this thread.

                so, you have to use JBP2.6 (GA release was out a few days ago).

                As far as I am doing, migrating from JBP2.4.1 to JBP2.6 is some work, depending of what things you have done to customize your portal on JBP2.4.1.
                It is some work, but all is worthy : nice features, better way of doing things. It is not a waste of time at all !
                And the Ajax feature is a very nice bonus (among others) that comes with JBP2.6.

                I guess you are not far from succes !

                • 5. Re: RichFaces : sample for ajax jsf portlet provided
                  chuaky

                  Thanks Antoine, no wonder i got such a hard time getting things to work :(

                  I guess i have to start the study to migrate my production system to new portal 2.6. Could you help me out a bit here, i'm lost in what new version to use here.

                  What should i use with JBoss Portal 2.6:

                  - JBoss AS 4.0.5GA or 4.2.0GA or 5 beta?
                  - JBoss Seam 1.2.1GA or 2.0.0 beta
                  - JDK (currently i'm using 1.5)


                  Previously i use the JEMS installer and it does all the installation for me. But there wasn't any new JEMS installer for long time, and if there is something i need to watch out for when installing the separate packages, please let me know too.

                  Cheers.

                  • 6. Re: RichFaces : sample for ajax jsf portlet provided
                    theute

                    JBoss AS 4.0.5GA or 4.2.0GA. (I would advise to use JBoss AS 4.2)

                    JBoss Seam support for portals has always been experimental ( http://wiki.jboss.org/wiki/Wiki.jsp?page=SeamPortlet ) , and is currently not working out of the box on Portal 2.6. We are working on a solution for integration.

                    JDK 1.4 or JDK 5

                    You don't need to use the JEMS installer anymore, just use the JBoss AS zip package. If you go with JBoss AS 4.2 it already includes EJB3.

                    • 7. Re: RichFaces : sample for ajax jsf portlet provided
                      chuaky

                      Thanks Thomas, would try to the suggestions and i had use seam and portlet together. I follow the example in seam samples for portal support.

                      Cheers.

                      • 8. Re: RichFaces : sample for ajax jsf portlet provided
                        antoine_h

                        Hello,

                        JBoss AS 4.0.5GA or 4.2.0GA or 5 beta?
                        about JBoss AS, I don't remember where, but I read something saying that their would be some problems with 4.2.0 (unfortunately !).
                        look at the wiki... may be you'll find about this.
                        I think it is about JSF and things that are newly organized with the embedded tomcat of that new version of JB AS.

                        It will be resolved, but as I want to try RichFaces (brand new too), I said "let's keep with 4.0.5... not to much change at one time".

                        so my advice is 4.0.5.

                        - JBoss Seam 1.2.1GA or 2.0.0 beta
                        I don't use Seam.
                        I keep my layers (DAO, business object, GUI) separate.
                        On my opinion, and for myself, there is yet a lot to do (and learn) with portal, JSF, RichFaces, EJB3...
                        Seam is intersting... but will try this nice integration concept and features later.

                        - JDK (currently i'm using 1.5)
                        1.5 is good.
                        no problem with that (portal in dev, portal in prod... working fine).


                        Take the JBoss Portal release, alone or bundle with JB AS 4.0.5.
                        both are fine.
                        The first time, I use the bundle, then upgrade (from RC3) with the alone version.

                        You may want also to update "sometime" your portal with the nightly build.
                        So you have all the new Jira resolved.

                        you can get it here :
                        http://cruisecontrol.jboss.com/cc/artifacts/jboss-portal-trunk-build
                        Note : when trying to deploy it, use the option "deploy-all" to have all the portal features (samples etc...) deployed.
                        The doc does not say to use this option. (see other forum post about this).

                        By the way, you can also use the last version of Hibernate (upgrade the jboss as and portal hibernate jar). It works fine.
                        Look at Hibernate web site to take the latest "best" one : there was a few general problem with one release (for MySQL).
                        I use hibernate3.2.4.sp1
                        This version of hibernate allow to use annotation with EJB3. Nice. (if you don"t use Seam). (you have to download the annotation jar and etc...).

                        have fun...

                        • 9. Re: RichFaces : sample for ajax jsf portlet provided
                          theute

                          I answered previously but here again ;)

                          JBoss AS 4.2.0 is the recommended AS (I know, we bundled with 4.0.5 but that was a small mistake but is consistent with the RCs version of JBoss Portal).

                          That said:
                          - JBoss Forums runs out of the box on 4.0.5 only
                          - WSRP requires a WS upgrade if you are running on 4.0.5, it will work out of the box with 4.2.0
                          - You should know that JBoss AS 4.0.5 ships myFaces implementation of JSF while JBoss 4.2.0 ships the Sun RI implementation
                          - JBoss AS 4.2 has EJB3 included

                          • 10. Re: RichFaces : sample for ajax jsf portlet provided
                            antoine_h

                            Thanks Thomas,

                            good to know for the JBoss AS recommendation.
                            I started looking at JB AS 4.2.0 for the portal 2.6, but when I saw the bundle and the JSF change, I stopped.

                            About JSF there's this wiki for the one that want to see what changed :
                            http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossFaces
                            and specifically this one :
                            http://wiki.jboss.org/wiki/Wiki.jsp?page=JBoss5AndMyFaces
                            so all should work...

                            I will use JB AS 4.2.0