javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-815

Resource URLs not rendered property if context path is the same as the path mapping of the FacesServlet

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0.0 EDR1
    • Fix Version/s: 2.0.0-b14
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      815

      Description

      To reproduce the issue, deploy jsf-guessNumber2.0.war to the context path of guess.

      Resource URLs are rendered as:

      /guess/javax.faces.resource/js/validator.js

      instead of:

      /guess/guess/javax.faces.resource/js/validator.js

      The problem is with UIViewRoot.getResourceURL():

      public String getResourceURL(FacesContext context, String path) {
      ExternalContext extContext = context.getExternalContext();
      if (path.charAt(0) == '/' &&
      !path.startsWith(extContext.getRequestContextPath()))

      { return (extContext.getRequestContextPath() + path); }

      else

      { return path; }

      }

        Activity

        Hide
        Ryan Lubke added a comment -

        Marking for 2.0

        Show
        Ryan Lubke added a comment - Marking for 2.0
        Hide
        Ryan Lubke added a comment -

        See spec issue 242

        Show
        Ryan Lubke added a comment - See spec issue 242
        Hide
        Ryan Lubke added a comment -

        update target milestone

        Show
        Ryan Lubke added a comment - update target milestone
        Hide
        Ed Burns added a comment -

        I feel like a deadbeat closing it this way, but it appears to work with a HEAD build from today,
        20090526, running on glassfishv3-j1-preview nightly 20090518, hudson build 24.

        Here's some source code for proof:

        <script type="text/javascript" src="/guess/guess/javax.faces.resource/js/validator.js"></script><link
        type="text/css" rel="stylesheet" href="/guess/guess/javax.faces.resource/css/styles.css" />

        I'll try it on v3-prelude and v2.1 and if it works in those places, I'll close it.

        Show
        Ed Burns added a comment - I feel like a deadbeat closing it this way, but it appears to work with a HEAD build from today, 20090526, running on glassfishv3-j1-preview nightly 20090518, hudson build 24. Here's some source code for proof: <script type="text/javascript" src="/guess/guess/javax.faces.resource/js/validator.js"></script><link type="text/css" rel="stylesheet" href="/guess/guess/javax.faces.resource/css/styles.css" /> I'll try it on v3-prelude and v2.1 and if it works in those places, I'll close it.
        Hide
        Ed Burns added a comment -

        Same story for v3-prelude

        <script type="text/javascript" src="/guess/guess/javax.faces.resource/js/validator.js"></script><link
        type="text/css" rel="stylesheet" href="/guess/guess/javax.faces.resource/css/styles.css" />

        and for v2

        <script type="text/javascript" src="/guess/guess/javax.faces.resource/js/validator.js"></script><link
        type="text/css" rel="stylesheet" href="/guess/guess/javax.faces.resource/css/styles.css" />

        Show
        Ed Burns added a comment - Same story for v3-prelude <script type="text/javascript" src="/guess/guess/javax.faces.resource/js/validator.js"></script><link type="text/css" rel="stylesheet" href="/guess/guess/javax.faces.resource/css/styles.css" /> and for v2 <script type="text/javascript" src="/guess/guess/javax.faces.resource/js/validator.js"></script><link type="text/css" rel="stylesheet" href="/guess/guess/javax.faces.resource/css/styles.css" />
        Hide
        Ryan Lubke added a comment -

        Update target milestone.

        Show
        Ryan Lubke added a comment - Update target milestone.
        Hide
        Manfred Riem added a comment -

        Closing issue out

        Show
        Manfred Riem added a comment - Closing issue out

          People

          • Assignee:
            Ed Burns
            Reporter:
            Ryan Lubke
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: