Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-5460

Strange a4j resource prefix with url-based servlet mappings

    Details

      Description

      My web.xml has several servlet mappings.

      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.jsf</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>/somepath1/*</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>/somepath999/*</url-pattern>
      </servlet-mapping>

      I'm doing this because I'm using some phaselistener that preproceses some things and also enables short-urls.

      Now, any page has a4j resources written like this:
      <script type="text/javascript" src="/MyContext/somepath999/a4j/g/3_2_2.SR1org/richfaces/renderkit/html/scripts/skinning.js">
      That is all a4j resources are now comprising the LAST servlet-mapping, just between the context name and the /a4j/ path part.

      I tried to workaround it, by putting the *.jsf mapping as the last in the web.xml but to no avail: the last servlet mapping path was always used.

      To reproduce, just download the demo application: http://download.jboss.com/jboss-richfaces/richfaces-demo-3.2.2.SR1-jee5.war
      Edit web.xml and add to the existing *.jsf mapping the following:
      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>/yeswecan/*</url-pattern>
      </servlet-mapping>

      Then deploy and look at the source of any page:
      <img class="rich-spacer " height="1" id="j_id258" src="/richfaces/yeswecan/a4j/g/3_2_2.SR1images/spacer.gif" width="1" style="height:10px;" />

      I'm not sure this is a bug or a feature of some sort. The code obviously takes ANY valid servlet mapping, which is fair enough. But maybe it should just check whether there is an extension-based mapping amongst them, and if yes, use it.
      Worse, this issue is also probably (conceptually) linked to https://jira.jboss.org/jira/browse/RF-3586

      Anyway, you're free to requalify this issue if you want. I'm reporting what I found and I'll find a workaround in the meantime.

      Thanks.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                fabmars Fabien Marsaud
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: