2 Replies Latest reply on Jul 25, 2008 4:19 AM by Dean Hiller

    seam adding .xhtml when I don't want that here

    Dean Hiller Expert

      I have the following rule...


                     <rule if="#{companyInfo.companyNameInSession}">
                              <redirect view-id="/${companyInfo.name}"></redirect>
                      </rule>



      companyInfo.name returns 'xsoftware' and seam send a redirect to xsoftware.html which I don't want!!!  I want the url in the browser to be xsoftware.  I have everything working perfect except that one little detail.  when my servlet filter receives xsoftware, it forwards it to the correct URI(which is actually company.xhtml used for all companies..not just xsoftware.  Any way to not have it add xhtml in this case?

        • 1. Re: seam adding .xhtml when I don't want that here
          Dan Allen Master

          I'm pretty sure this is standard behavior inside of JSF (so it goes deeper than Seam). If you want a quick fix, I would use the URLRewriteFilter to strip it. The configuration is pretty straightforward:


          <outbound-rule>
            <from>^(/.+)?/xsoftware.seam$</from>
            <to>$1/xsoftware</to>
          </outbound-rule>
          



          In this case, use:


          <redirect view-id="/#{companyInfo.name}.xhtml}"/>
          



          That should work. If not, play around with it.

          • 2. Re: seam adding .xhtml when I don't want that here
            Dean Hiller Expert

            thanks, I eventually used URLRewrite, and once I fixed the bug in it, it worked great!!!  The bug was that it uses find instead of match which is a big difference in that it may find your match WITHIN the string whereas match has to match the entire string.  Once changed their code, it worked great....I did submit a fix but I think it is just sitting there on their bugs list.



            ie. ^aa$ on pattern aabb




            1. returns true on find method(which is not desired..if I wanted to include bb, I would have made it optional and included it)


            2. returns false on matches method


            in URLRewriter, they used find which screwed things up and cost me alot of time!!!!
            later,
            dean