2 Replies Latest reply on Aug 17, 2012 10:28 AM by lincolnthree

    no cid in URL when start a conversation - so it ends badly [prettyfaces/weld]

    tonyherstell

      Is this a know problem and is there a workround?

       

       

      Cross post:

       

      http://forum.primefaces.org/viewtopic.php?f=3&t=17995&p=55784#p55784

       

       

      After much ferkeling I have found a workaround:

      Using the eclipse debugger finding the current conversation id... (break on the "init" method and look at the local variable for conversation)

      e.g. if conversation is 2

      then

      add the string "?cid=2" to the end of the URL (initially http://localhost:8080/X/users/manage):

      http://localhost:8080/X/users/manage?cid=2

      now refresh the page and pretty much all calls after this will have the conversation.


      the ?cid=2 seems to be correctly sent through when required from the first creation of the conversation.


      So its either

      Weld, majorra, or prettyfaces that have the bug in that they are not adding the correct ?cid=x to the initial URL.


      I will start with the Weld Forum.


      Thx.

        • 1. Re: no cid in URL when start a conversation - so it ends badly [prettyfaces/weld]
          tony.herstell1

          Workaround:

           

           

          Force (brutually) PrettyFaces to include the cid:

           

                    <url-mapping id="manageUsers">

                              <pattern value="/users/manage"></pattern>

                              <view-id>/pages/users/manageUsers.xhtml</view-id>

                              <query-param name="cid">#{userManagementController.cid}</query-param>

                    </url-mapping>

           

           

                    <url-mapping id="createUser">

                              <pattern value="/users/create"></pattern>

                              <view-id>/pages/users/createUser.xhtml</view-id>

                              <query-param name="cid">#{userCreationController.cid}</query-param>

                    </url-mapping>

           

           

           

          In the controller:

           

           

           

              /*

               * Hack to pass cid to prettyfaces so it can add it to URL

               * DONT remove.

               */

              public String getCid() {

                  return this.conversation.getId();

              }

              public void setCid(String cid) {

              }

           

           

           

           

           

           

           

          Not pretty but it works.

           

           

          http://localhost:8080/entermyevents/users/manage?cid=2

           

           

           

           

          oddly; myeclipse validator does not like the line

           

           

           

          <query-param name="cid">#{userManagementController.cid}</query-param>

          • 2. Re: no cid in URL when start a conversation - so it ends badly [prettyfaces/weld]
            lincolnthree

            Nice workaround!