2 Replies Latest reply on Aug 13, 2010 6:27 AM by Uwe Rasmus

    Linking

    Uwe Rasmus Newbie

      Hi,
      this is possibly very easy, but I cannot find any enlightening point.


      Should I use .seam or .xhtml when trying to navigate between views/pages/actions in Seam?


      I can see that in web.xml is *.seam mapped to FacesServlet. So if I use .xhtml the Faces phases are not applied?
      In most of the examples there is always used .xhtml. Almost never I have seen navigating with .seam. (therefore I assume the faces phases are applied, just don't understand how is that possible)
      I just don't get it. Could someone explain these basics to me?


      And if there is some difference, what is it?


      Thanks a lot
      Uwe

        • 1. Re: Linking
          Nikos Paraskevopoulos Novice

          Hi,


          The .xhtml extension is used for internal references of views in the application. So whenever you need to <ui:include> something or <s:link> to something, use .xhtml.


          On the other hand .seam is used for extenral references. I.e. this how the outer world knows your views. So you say hey check out my app, it can be found at www.myserver.com/index.seam. Likewise, any link you put in the application that does not pass through some JSF mechanism needs to end with .seam. E.g. if you include a standard HTML <a> tag, the href attribute will have to end in .seam, not.xhtml.


          When using this setup it is allways a good idea to forbid direct external access to .xhtml resources. (I'm not sure if this is done when a project is generated for Seam.)


          Good luck!

          • 2. Re: Linking
            Uwe Rasmus Newbie

            That's perfect answer, now I finally understand it.
            Thanks a lot, Uwe