4 Replies Latest reply on Feb 5, 2008 2:13 AM by brombie

    Reorganizing templates in WEB-INF

    brombie

      Hi all,

      I'm pretty new to all of this and I'm still making way through all the configuration files. There's certainly a lot of them!

      One issue I have is how too manage all the template/xhtmls files under WEB-INF. Instead of putting all of them under WEB-INF, I'd like to store them under different folders, e.g:
      WEB-INF/registration
      WEB-INF/shoppingcart
      etc.

      I'd also like each folder to contain both the seam page xmls (page.xml) and the templates (xhtml). Is this possible in Seam? If yes, which configuration file should I look at?

      I tried just moving around my files, but the default configuration only allow files that are directly under WEB-INF. For example:

      If I put registration.xhtml and registration.page.xml under WEB-INF, then I can just go to http://localhost/myapp/registration.seam to see it.

      If I move them under WEB-INF/registration, then http://localhost/myapp/registration/registration.seam doesn't work.

      Thanks for your help!

        • 1. Re: Reorganizing templates in WEB-INF
          baz

          I am not sure what you mean.
          If you have a web project generated with jboss tools all pages are in the Web-Content folder.
          If you use a seam-gen project, all pages are in the view folder.
          You can build up any hierachy in these folders. the *.page.xml belongs in the same folder where the coresponding *.xhtml is.
          I have never seen, that pages are stored in the WEB-INF folder.

          • 2. Re: Reorganizing templates in WEB-INF
            brombie

            Sorry, you're right, please replace all WEB-INF references in my original post to WebContent.

            I tried building up the hierarchy inside WebContent, but if the xhtml and page.xml is not directly under WebContent, Seam is not picking them up.

            • 3. Re: Reorganizing templates in WEB-INF
              nickarls

              You will have to add the path to all references of the page also. So if you have an

              <ui:include src="foo.xhtml"/>
              


              it should become

              <ui:include src="/thefolder/foo.xhtml"/>
              


              Same goes everywhere the page is referenced - templates, navigation etc.

              • 4. Re: Reorganizing templates in WEB-INF
                brombie

                Thank you, that's what I've been missing!