1 Reply Latest reply on Feb 13, 2011 12:26 PM by monkeyden

    How to force add cid parameter in the url

    aislam

      Hello,


      I'm trying to make sure that my URLs always include cid parameter with the current conversation id. Is there any way to configure that? Here is a bit of code snippet, if any one can tell me how I can add the cid parameter to it that would be really helpful. I'm using Seam 2.2.0.GA and JBoss 5.1.0.


      profile.page.xml



      <?xml version="1.0" encoding="UTF-8"?>
      <page xmlns="http://jboss.com/products/seam/pages"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd">
      
          <action execute="#{profile.controlPageFlow}" />
      
          <navigation from-action="#{profile.controlPageFlow}">
              <rule if-outcome="toAccountRequestPage">
                  <end-conversation />
                  <redirect view-id="/accountRequest.xhtml" />
              </rule>
              <rule if-outcome="toProfilePage">
                  <begin-conversation join="true"/>
              </rule>
        </navigation>
      </page>
      




      controlPageFlow in the backing bean:



      public String controlPageFlow() {
              if (user.getInstance().getId() == null) {
                  return "toAccountRequestPage";
              }
              else {
                  return "toProfilePage";
              }
      }



      I would like to make sure that when it reaches the profile page the url looks like -




      http://localhost:8080/myapp/profile.seam?cid=[coversation.id]





      Right now I don't get the cid parameter and value, so when I click refresh, it creates another conversation. I would like to stop it.


      Any help would be really appreciated.


      Thank you,
      Arif