Details

    • Issuezilla Id:
      820
    • Status Whiteboard:
      Hide

      size_medium importance_medium

      Show
      size_medium importance_medium

      Description

      The purpose of this enhancement request is to make it easier to reference
      resource URLs in custom components.

      In JSF 2, a great EL shortcut was introduced to get the url for resources using
      the resource implicit object (e.g. #resource['/library/image.jpg']). But there
      is no easy programmatic way of resolving resource URLs inside a custom
      component. For example if an image resource lies inside
      META-INF/resources/library/image.jpg, there is no convenient way of referencing
      the path of the image when writing an "img" tag inside my UIComponent.

      Ideally such method should exist in ResourceHandler and users can invoke it
      using
      facesContext.getApplication().getResourceHandler().getRequestPath("image.jpg","library"),
      but resource handler has no such method to find a resource in META-INF/resources.

      In lieu of this, you can do the following (Suggested by Ed Burns):

      ResourceHandler rh = facesContext.getApplication.getResourceHandler();
      Resource r = rh.createResource("image.jpg", "library");
      rh.getRequestPath();

      This would work, but it is not as nice as getResourceHandler().getRequestPath().

      This will give Component developers some ease, especially when there are
      implementing components that deal with javascript extensively.

      Thanks.

        Activity

        Hide
        razib added a comment -

        This is an enhancement request.

        Show
        razib added a comment - This is an enhancement request.
        Hide
        Ed Burns added a comment -

        edburns

        Show
        Ed Burns added a comment - edburns
        Hide
        Ed Burns added a comment -

        triage

        Show
        Ed Burns added a comment - triage
        Hide
        rogerk added a comment -

        triage

        Show
        rogerk added a comment - triage
        Hide
        Ed Burns added a comment -

        Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

        Show
        Ed Burns added a comment - Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

          People

          • Assignee:
            Unassigned
            Reporter:
            razib
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: