6 Replies Latest reply on Dec 6, 2008 12:29 PM by frankyb

    Integrate JSF and Seam into a website

    frankyb

      Hi all,


      I'm going to develop a new website soon. It's main goal is to present a company's products, so there is not much application logic and basically, using PHP or even plain HTML/CSS would be sufficient.


      However, we want to integrate an existing Seam/RichFaces application that allows our customers to log in and to do some interactions. So the website is going to have two parts, a presentational part mainly consisting of static html and an interactive part, a Seam powered web application. These two parts should be integrated seamlessly, for example the Login box should appear on each particluar page.


      Now I'm about to find the best way to achieve this goal. The first, probably easiest and most obvious solution is to use JSF/Seam/Richfaces for the static parts of the page, too.
      However, I'm concerned whether this is a waste of resources: JSF is known not to be the fastest web framework, since according to the JSF lifecycle, the whole component tree is parsed and evaluated on each single request.


      This leads to the following question:
      when I use usual HTML tags (p, div, ...) in an JSF/Seam application instead of things like h:outputText, are these HTML elements considered in the request processing, too? Or are they just skipped and result in a better performance?


      Are there any suggested approaches for my scenario in general?


      Thanks in advance,
      Frank

        • 1. Re: Integrate JSF and Seam into a website
          georges.goebel

          Hi,


          You can use the html iframe tag to include the jsf/seam applications in your static or php stuff.


          Georges

          • 2. Re: Integrate JSF and Seam into a website
            joblini

            Frank Bitzer wrote on Dec 03, 2008 17:05:


            should be integrated seamlessly


            Heh heh good one :-)


            I don't see the problem, if your pages have the extension .html JSF won't touch them.


            Hope this helps!

            • 3. Re: Integrate JSF and Seam into a website
              joblini

              You can do the login using a plain HTML form, then, redirect to the JSF/Seam portion of your site. 

              • 4. Re: Integrate JSF and Seam into a website
                frankyb

                Hi,


                thank you for your answers, both your suggestions are very good. I will think about it.


                Do you have some experiences in combining Tomcat (for serving JSF content) with Apache httpd (for static or PHP stuff)? Does this work without problems? Or is it probably the better alternative to let Tomcat serve the static HTML, too?



                Frank

                • 5. Re: Integrate JSF and Seam into a website
                  joblini

                  I think, only if Apache is in front of Tomcat and you save a network hop.


                  Otherwise, I can't imagine why Apache would be better than Tomcat at simply copying a file to the OutputStream.  Again, if the file extension is HTML there is no scanning and interpretation of pages, they ae just served as is.


                  You also have to balance the cost of hardware against the complexity (cost) of development and deployment.  It is much simpler if everything goes into a single war file which is deployed to Tomcat.  On the other hand, if there are a large number of Flash or other media files to serve, it is probably more convenient to deploy them separately.


                  Anyways, this is all somewhat hypothetical, if it is really a concern why not set up both configurations and compare them with a tool like JMeter?


                  • 6. Re: Integrate JSF and Seam into a website
                    frankyb

                    Well, the main disadvantage of Tomcat is that it can not serve PHP files (or am I wrong here?). It's not sure yet, but probably I will use the PHP templating engine Smarty.


                    But you are right, it's all  hypothetical. In case I can afford some time, I will do some testing.