3 Replies Latest reply on Oct 11, 2009 4:13 PM by muhviehstarr

    Spread xhtmls across jars?

    stephanos

      Hi,


      I was wondering how to split up the xhtml-files of a WAR-project across multiple sub-projects (probably JARs)?
      (not sure if this is a Seam / Facelets / JSF issue - but since in this community the members have knowledge about all 3 areas I ask here)



      The reason:


      I have probably around 60 pages - some composed by dozens of xhtml files. I wrote several ui tests (WebDriver/Selenium). Those tests take an eternity to run - and every time I change an admin page for example, all tests are re-run in Hudson (CI) because they are all in the same project and triggered thereby. I wanted to split my xhtmls across different sub-projects like sub-admin, sub-user.. This way I could share common resources (like CSS) and still separate the view.


      From what I saw this might be (?) possible with JSF2 - but I'm stuck with 1.2 until RichFaces 4.0 and Seam 3.0 are released.


      So is it possible :-?


      Cheers!

        • 1. Re: Spread xhtmls across jars?
          barakka

          Hi,


          you basically want to follow the same approach used by the Seam wiki plugin architecture. There should be an article here on the seam web site, but I can't seem to find it anymore.


          Anyway, the solution is to create a custom facelet resource resolver (implementing the ResourceResolver interface) which will load the xhtml pages from the whole application classpath. You install it in your web.xml like this:




          <context-param>
                <param-name>facelets.RESOURCE_RESOLVER</param-name>
                <param-value>es.tsbsoluciones.platform.utils.web.ClasspathResourceResolver</param-value>
           </context-param>





          I'm quite sure there are several posts that explain the issues involved, but again, this morning it seems I'm out of luck with the site search engine.


          Best,
          Riccardo.

          • 2. Re: Spread xhtmls across jars?
            stephanos

            Thanks for the tip! I'll look into it.

            • 3. Re: Spread xhtmls across jars?
              muhviehstarr

              Pay attention that this is only respected by Facelets for xhtml-files and is not useable for other resources like css, images and so on.