4 Replies Latest reply on Dec 7, 2007 12:48 PM by Alexander Smirnov

    Configure RESOURCE_URI_PREFIX

    dennis chan Newbie

      In my application environment, Apache web server is filtered URI and forward request to JBoss Application Server. I need to have ajax calls prefix to the a CONSTANT application URI (say, prefix with webajax) instead of the default prefix with a4j_version (e.g. /a4j_3_1_2.GAorg.ajax4jsf) which may be changed. Searching the web landed me to the following URL

      http://jira.jboss.com/jira/browse/AJSF-80

      However, I still having problem setting up the RESOURCE_URI_PREFIX in web.xml. I have been trying different ways to configure without any success.

      <context-param>
       <param-name>org.ajax4jsf.RESOURCE_URI_PREFIX</param-name>
       <param-value>webajax/</param-value>
      </context-param>
      

      or
      <filter>
       <display-name>Richfaces Filter</display-name>
       <filter-name>richfaces</filter-name>
       <filter-class>org.ajax4jsf.Filter</filter-class>
       <init-param>
       <param-name>org.ajax4jsf.RESOURCE_URI_PREFIX</param-name>
       <param-value>webajax/</param-value>
       </init-param>
      </filter>
      


      Do anyone have any experience doing the RESOURCE_URI_PREFIX setup ?

        • 1. Re: Configure RESOURCE_URI_PREFIX
          Alexander Smirnov Master

          Oops, it is a real bug in the framework. Watch for a http://jira.jboss.com/jira/browse/RF-1513 , it must be fixed in the coming release.
          Thanks for a your attentiveness !

          • 2. Re: Configure RESOURCE_URI_PREFIX
            dennis chan Newbie

            Thanks for the prompt reply!! Looking forward for the fix in next release.

            • 3. Re: Configure RESOURCE_URI_PREFIX
              dennis chan Newbie

              Further looking at the code from Firebug trace. With the patch on 3.1.3. Our Apache env should have no problem forward the request to JBoss AS with the following code :

              <script type="text/javascript" src="/a4j_3_1_2.GAorg/richfaces/renderkit/html/scripts/suggestionbox.js.seam"/>
              

              For example, the prefix configuration will replace
              <script type="text/javascript" src="/webajax/richfaces/renderkit/html/scripts/suggestionbox.js.seam"/>
              


              What about the following code ?
              <script type="text/javascript" src="/a4j_3_1_2.GAorg.ajax4jsf.javascript.AjaxScript.seam"/><script type="text/javascript" src="/a4j_3_1_2.GAorg.ajax4jsf.javascript.PrototypeScript.seam"/>
              <script type="text/javascript" src="/a4j_3_1_2.GAorg.ajax4jsf.javascript.SmartPositionScript.seam"/>
              


              Note : the src in in the root directory.

              Would it replace by ?
              <script type="text/javascript" src="/webajax/ajax4jsf.javascript.AjaxScript.seam"/><script type="text/javascript" src="/webajax/ajax4jsf.javascript.PrototypeScript.seam"/>
              <script type="text/javascript" src="/webajax/ajax4jsf.javascript.SmartPositionScript.seam"/>
              


              Appending a directory /webajx (our example) in front ?

              • 4. Re: Configure RESOURCE_URI_PREFIX
                Alexander Smirnov Master

                With a fixed bug, all references to a scripts & styles will be prefexed with with your value. "a4j_3_1_2.GA" is a default value, and you can replace it with any other. Keep in mind, RichFaces framework will use it value for detect requests to a off-page resources, so it must be unique value for a your application.
                We have a plan to deploy release-candidate 2 for a richfaces 3.1.3 today ( 12/07/2007 ) to a Jboss Maven repository, version string for a Maven projects "3.1.3.CR2". This build also have a fixed prefix parameter bug.