2 Replies Latest reply on Dec 8, 2009 1:27 PM by bashan

    Rewrite problem

    bashan

      Hi,


      I am trying to implement url rewrite and having some problems. This is my pages definition:



        <page view-id="/home.xhtml" login-required="true">
          <rewrite pattern="/home/{filter}/{page}"/>
          <rewrite pattern="/home/{filter}"/>
          <rewrite pattern="/home"/>
          <param name="filter" required="false" />
          <param name="page" required="false" />
        </page>



      I have links on the page:



       <ul id="subtabHome" class="sublinks" style="#{selectedTab == 'tabHome' ? '' : 'display:none;'}">
                <li><s:link value="All" view="/home.xhtml" propagation="none"</s:link></li>
                <li>|</li>
                <li><s:link value="Photos" view="/home.xhtml" propagation="none"><f:param name="filter" value="photos" /></s:link></li>
                <li>|</li>
                <li><s:link value="Comments" view="/home.xhtml" propagation="none"><f:param name="filter" value="comments"/></s:link></li>
              </ul>



      Pressing one of the links is working good. But after, for example, pressing on photos link, the home link (this is the first link in the list), become: home/photos, although I expect it to be: /home only. Is the a way solving this issue?


      Thanks.




        • 1. Re: Rewrite problem
          norman

          Does setting filter="" on the first link work?

          • 2. Re: Rewrite problem
            bashan
            Thanks for your answer. The first thing I tried was: filter="", but it didn't work. It is reasonable that it didn't work, since "" is a proper value. I finally resolved this issue by doing: filter="#{null}". It is not so nice, but it seems to work fine.