3 Replies Latest reply on Jan 17, 2008 3:17 PM by christian.bauer

    conversationId on commandlink with viewId in action

    mail.micke

      Hi,
      I just tested using a normal h:commandLink with a viewId in the action attribute and noticed that a conversationId was added to the new URL.


      <h:form>
      <h:commandLink value="viewId link" action="/jsf/admin/index.html"/>
      </h:form>
      


      Since I'm not using conversations it is a bit annoying :)


      JSF 1.2
      Seam 1.2.1


      Thanks,
      Micke

        • 1. Re: conversationId on commandlink with viewId in action
          christian.bauer

          This is not how you link to views, this is a form POSTback. Use s:link if you want a GET request and disable conversation propagation, read the docs. Or use plain JSF h:outputLink if you want to hardcode URLs.

          • 2. Re: conversationId on commandlink with viewId in action
            mail.micke

            Thanks for replying.


            I'll give s:link a go, but I wasn't expecting to have to use that tag unless I wanted to work with conversations.


            I was just testing how seam handled viewId action outcomes, for instance if I return the viewId from an action method (gave me the conversationId).


            Please don't tell me this is a bad idea ;) , already know that a pages.xml or a faces-nav.xml are preferrable. Just playing around.


            Could you please explain under which cases there will be a conversationId added to the URL. We are currently in the process of migrating an appliation to jsf/seam and we do not want conversationId's unless we explicitly need a long running converasation.


            Cheers

            • 3. Re: conversationId on commandlink with viewId in action
              christian.bauer

              Seam always adds a conversationId to URLs unless you disable conversation propagation for a particular link. Again, check the docs for how this is done.


              There is only one technical reason why you wouldn't want a conversation id: search engine optimization. For that use case (or if you have aesthetic wishes), use inbound/outbound URL rewriting. The dvdstore and wiki example in CVS demonstrate this.