8 Replies Latest reply on Feb 9, 2007 11:07 AM by Norman Richards

    Seam Examples

    jk;l jkl; Expert

      I have some questions after taking a look at the Seam booking example.

      1) How does going to /seam-booking automatically redirect to /seam-booking/home.seam? I don't see anything in web.xml or pages.xml where this behavior has been configured.

      2) In the example's pages.xml there is a no-conversation-view-id attribute for the pages element and a conversation-required attribute for some of the page elements. I noticed that everytime I access a page with a conversation-required, it redirects to the no-conversation-view-id...is this the purpose of these two attributes? (i.e. The conversation-required page redirects to the no-conversation-view-id page when no conversation exists?)

      3) When I click the "Register New User" link on the home.seam page, there's a cid in the address bar. Now when I go to a conversation-required page it still forwards to home.seam rather than going to the page I requested...why? A conversation now exists...

      4) When a conversation-required page redirects to the no-conversation-view-id page, a conversation starts! (e.g. you enter confirm.seam and it forwards to home.seam?cid=1) Why is a conversation starting here...I don't see anything in pages.xml or any @Begin to indicate this...

      5) All the action methods seem to have a return type of void rather than String...is this the new recommended way of making action methods because of pages.xml?

        • 1. Re: Seam Examples
          Mariusz Smykula Newbie

           

          "lightbulb432" wrote:

          1) How does going to /seam-booking automatically redirect to /seam-booking/home.seam? I don't see anything in web.xml or pages.xml where this behavior has been configured.

          There is default page index.html, which make redirect to home.seam
          <html>
          <head>
           <meta http-equiv="Refresh" content="0; URL=home.seam">
          </head>
          </html>




          • 2. Re: Seam Examples
            jk;l jkl; Expert

            I think I figured out #3...even though there's a cid in the address bar, there's not a clr=true so I guess that makes sense.

            Anybody have any insights on #2,4,5? Your help would be greatly appreciated.

            • 3. Re: Seam Examples
              Hung Tang Apprentice

               

              "lightbulb432" wrote:

              2) In the example's pages.xml there is a no-conversation-view-id attribute for the pages element and a conversation-required attribute for some of the page elements. I noticed that everytime I access a page with a conversation-required, it redirects to the no-conversation-view-id...is this the purpose of these two attributes? (i.e. The conversation-required page redirects to the no-conversation-view-id page when no conversation exists?)

              Yes. however, it happens when no long-running conversation exists as there will ALWAYS be a temporary conversation.

              "lightbulb432" wrote:

              4) When a conversation-required page redirects to the no-conversation-view-id page, a conversation starts! (e.g. you enter confirm.seam and it forwards to home.seam?cid=1) Why is a conversation starting here...I don't see anything in pages.xml or any @Begin to indicate this...

              http://docs.jboss.com/seam/1.1GA/reference/en/html/conversations.html
              6.1 Seam's conversation model

              Again, a temporary conversation != long running conversation.

              • 4. Re: Seam Examples
                jk;l jkl; Expert

                Thanks for your response. If there's always at least a temporary conversation, why do I sometimes see a cid and sometimes not in the address bar?

                • 5. Re: Seam Examples
                  Hung Tang Apprentice

                  That's the behaviour of s:link/s:button. It will append a cid to the url, if it finds a conversation (which is what you see). It will append a clr if it detects the conversation as long-running (which you don't see, because its not long running)

                  • 6. Re: Seam Examples
                    Gavin King Master

                    And, of course, when you do a JSF postback, the conversation id is propagated via a different mechanism.

                    • 7. Re: Seam Examples
                      jk;l jkl; Expert

                      I noticed that all the Seam examples use HSQLDB, and their Ant builds work perfectly even though I've done no HSQLDB install or configuration on my end.

                      Where are the HSQLDB JARs located (couldn't find them in the deployed EAR, or JBOSS_HOME/server/default/lib)? It seems a little weird that it's working so well!

                      • 8. Re: Seam Examples
                        Norman Richards Master

                        server/default/lib/hsqldb-plugin.jar
                        server/default/lib/hsqldb.jar