1 Reply Latest reply on Mar 2, 2009 9:03 PM by miguelz

    Broken script header with Seam 2.1.1 GA + Richfaces > 3.1.4 + Tuckey urlrewrite

    miguelz
      Got some strange problem after updating Richfaces from 3.1.4 to 3.2.2 in Seam 2.1.1 GA keeping on using the old (more powerful) way of url rewriting with tuckey.org's urlrewritefilter:

      The same page gives three different outputs:


      Output with Richfaces 3.1.4 (working):
      ...
      <html xmlns:jsp="http://java.sun.com/JSP/Page" xmlns="http://www.w3.org/1999/xhtml">
      <script src="/projname/a4j_3_1_4.GAorg.ajax4jsf.javascript.AjaxScript.seam" type="text/javascript"><!--//--></script>
      <script src="/projname/a4j_3_1_4.GAorg/ajax4jsf/javascript/scripts/form.js.seam" type="text/javascript"><!--//--></script>
      <form id="...


      Output with Richfaces 3.2.2 WITHOUT URL rewriting (working):
      ...
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
           <script type='text/javascript' src='/projnamea4j/g3_2_2.SR1org.ajax4jsf.javascript.AjaxScript.seam'></script>
           <script type='text/javascript' src='/projname/a4j/g/3_2_2.SR1org/ajax4jsf/javascript/scripts/form.js.seam'></script>
      </head>
      <form id="...


      Output with Richfaces 3.2.2 USING URL rewriting (NOT WORKING):
      ...
      <html xmlns="http://www.w3.org/1999/xhtml">
      <form id="...

      --> the header and script tags are completely missing ... AJAX forms are not working.



      My urlrewrite.xml configuration looks like this:

      ...
      <urlrewrite>
          
         <rule>
           <from>^/([a-z]+)[\/]{0,1}$</from>
           <to last="true">/$1.seam</to>
         </rule>

        <outbound-rule>
          <from>^/projname/([a-z]+).seam$</from>
          <to last="true">/projname/$1</to>
        </outbound-rule>

           
      </urlrewrite>


      I've already tried deactivating the outbound rule and omitting the projname, but it did not change anything.


      Any hint?


      Miguel
        • 1. Re: Broken script header with Seam 2.1.1 GA + Richfaces > 3.1.4 + Tuckey urlrewrite
          miguelz
          I solved the issue changing my web.xml:


          1. url-pattern of Seam Filter changed from *.seam to /*

          2. order of filters changed:

          1 - Seam Filter
          2 - UrlRewriteFilter

          Cheers!

          Miguel


          P.S.:
          To use the seam way to rewrite urls it's just:

          1. Enable Seam Filter in web.xml, if not enabled (see documentation)
          2. Put <web:rewrite-filter view-mapping="*.seam"/> in components.xml
          3. Add <rewrite .../> statements inside <page ...>...</page> in pages.xml