Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.2 Sprint 11 B
    • Component/s: Navigation
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Macintosh

    • Issuezilla Id:
      809
    • Status Whiteboard:
      Hide

      size_large importance_medium

      Show
      size_large importance_medium
    • Tags:

      Description

      In Facelets 1.x, it was possible to implement load views from external locations (such as the class path,
      or a repository) by providing a ResourceResolver implementation.

      The ResourceResolver is also present in JSF 2, so this is still possible. However, there is a new
      requirement. Implicit navigation calls ExternalContext.getResource() to determine whether a view id
      corresponds to a physical resource. If ExternalContext.getResource() returns a non-null URL, implicit
      navigation to the view id is allowed.

      This contract is not ideal, as:

      1. It is non-obvious.
      2. It requires hooking into multiple locations.
      3. It makes it difficult to distinguish between requests for view ids vs. other types of resources.

      Regarding #3… ExternalContext.getResource() may be used for all sorts of resources. In our case we
      only want to search our external repositories when a view id is requested, but not, say, when someone
      calls getResource() to load some other type of file (eg. a style sheet).

      We need to introduce a cleaner contract that simplifies the responsibilities for custom view loading
      implementations.

        Issue Links

          Activity

          aschwart created issue -
          Hide
          Ed Burns added a comment -

          2.1.

          Show
          Ed Burns added a comment - 2.1.
          Hide
          Ed Burns added a comment -

          Add adf keyword

          Show
          Ed Burns added a comment - Add adf keyword
          Hide
          Ed Burns added a comment -

          triage

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

          rogerk

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

          triage

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

          triage

          Show
          rogerk added a comment - triage
          kenaiadmin made changes -
          Field Original Value New Value
          issue.field.bugzillaimportkey 809 20414
          Hide
          kito75 added a comment -

          I think it'd make sense to unify the resource-handling mechanism with the ResourceResolver. This would solve a few issues:

          (1) Provide the ability to load Facelet views from a JAR without writing a custom class.
          (2) Provide a single entry point for customizing resource resolution and view resolution.
          (3) Allow views (or sets of views) to be versioned and localized
          (4) Lay the groundwork for application modules – a set of views, images, stylesheets, etc., inside of a JAR file.

          Basically, all we'd need is to define a mapping between a URL and a view within a resource library. A sensible default with the ability to override it in faces-config.xml would suffice.

          Show
          kito75 added a comment - I think it'd make sense to unify the resource-handling mechanism with the ResourceResolver. This would solve a few issues: (1) Provide the ability to load Facelet views from a JAR without writing a custom class. (2) Provide a single entry point for customizing resource resolution and view resolution. (3) Allow views (or sets of views) to be versioned and localized (4) Lay the groundwork for application modules – a set of views, images, stylesheets, etc., inside of a JAR file. Basically, all we'd need is to define a mapping between a URL and a view within a resource library. A sensible default with the ability to override it in faces-config.xml would suffice.
          Hide
          kito75 added a comment -
          Show
          kito75 added a comment - Related issues: Make flows reusable http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-730 Support for modular, reusable, fragments of a web application http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-532 Plugin System http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-970
          Ed Burns made changes -
          Comment [ Empirically speaking, I'm finding that the resource request for javax.faces jsf.js is *not* causing ExternalContext.getResource() to be called. Therefore, I refute your assertion that

            Regarding #3… ExternalContext.getResource() may be used for all sorts of resources. In
            our case we
            only want to search our external repositories when a view id is requested, but not, say,
            when someone
            calls getResource() to load some other type of file (eg. a style sheet).

          ]
          Hide
          Ed Burns added a comment -

          As evidence of the problem listed in the summary of the bug:

          3. It makes it difficult to distinguish between requests for view ids vs. other types of resources.

          Consider this ad hoc log output from getResource():

          INFO: getResource: /index.xhtml
          INFO: getResource: /resources/compositeTest/foo.xhtml
          INFO: getResource: /resources/ezcomp/LoginProductName.png
          INFO: getResource: /resources/ezcomp/add-rem_header.gif
          INFO: getResource: /resources/ezcomp/alertbackground_bottom_left.gif
          INFO: getResource: /resources/ezcomp/alertbackground_bottom_right.gif
          INFO: getResource: /resources/ezcomp/alertbackground_middle.gif
          INFO: getResource: /resources/ezcomp/alertbackground_top.gif
          INFO: getResource: /resources/ezcomp/alertbackground_top_left.gif
          INFO: getResource: /resources/ezcomp/alertbackground_top_right.gif
          INFO: getResource: /resources/ezcomp/background_border_bottom.gif
          INFO: getResource: /resources/ezcomp/bg_gradient.gif
          INFO: getResource: /resources/ezcomp/bg_gradient_disabled.gif
          INFO: getResource: /resources/ezcomp/bg_gradient_selected.gif
          INFO: getResource: /resources/ezcomp/bkgrnd.gif
          INFO: getResource: /resources/ezcomp/calpop_dropshadow.png
          INFO: getResource: /resources/ezcomp/calpop_footer_grad.gif
          INFO: getResource: /resources/ezcomp/colorAndMedia.css
          INFO: getResource: /resources/ezcomp/column_hdr_gradient.gif
          INFO: getResource: /resources/ezcomp/column_hdr_hov_gradient.gif
          INFO: getResource: /resources/ezcomp/column_hdr_sort_gradient.gif
          INFO: getResource: /resources/ezcomp/column_hdr_sort_hov_gradient.gif
          INFO: getResource: /resources/ezcomp/commontaskssection.css
          INFO: getResource: /resources/ezcomp/componentWithBackingJavaClass.groovy
          INFO: getResource: /resources/ezcomp/componentWithBackingJavaClass.xhtml
          INFO: getResource: /resources/ezcomp/css_master.css
          INFO: getResource: /resources/ezcomp/css_ns6up.css
          INFO: getResource: /resources/ezcomp/date_time_gradient.jpg
          INFO: getResource: /resources/ezcomp/dot.gif
          INFO: getResource: /resources/ezcomp/failed_small.gif
          INFO: getResource: /resources/ezcomp/grad1.gif
          INFO: getResource: /resources/ezcomp/grad2.gif
          INFO: getResource: /resources/ezcomp/gradation-grey.gif
          INFO: getResource: /resources/ezcomp/gradlogbot.jpg
          INFO: getResource: /resources/ezcomp/gradlogsides.jpg
          INFO: getResource: /resources/ezcomp/gradlogtop.jpg
          INFO: getResource: /resources/ezcomp/gradtblhdr.gif
          INFO: getResource: /resources/ezcomp/gradtblhdrsrt.gif
          INFO: getResource: /resources/ezcomp/gradtblttl.jpg
          INFO: getResource: /resources/ezcomp/grouprow_gradient.gif
          INFO: getResource: /resources/ezcomp/header-short.gif
          INFO: getResource: /resources/ezcomp/help_btnnav_gradient.jpg
          INFO: getResource: /resources/ezcomp/indeterminate.gif
          INFO: getResource: /resources/ezcomp/layout.css
          INFO: getResource: /resources/ezcomp/left-pane-background.gif
          INFO: getResource: /resources/ezcomp/leftBottom.gif
          INFO: getResource: /resources/ezcomp/leftTop.gif
          INFO: getResource: /resources/ezcomp/left_pane_grad.jpg
          INFO: getResource: /resources/ezcomp/level1_background.jpg
          INFO: getResource: /resources/ezcomp/level1_deselect.jpg
          INFO: getResource: /resources/ezcomp/level1_selected-1lev.jpg
          INFO: getResource: /resources/ezcomp/level1_selected-1lvl.jpg
          INFO: getResource: /resources/ezcomp/level1_selected-left.jpg
          INFO: getResource: /resources/ezcomp/level1_selected-middle.jpg
          INFO: getResource: /resources/ezcomp/level1_selected-right.jpg
          INFO: getResource: /resources/ezcomp/level1_selected.jpg
          INFO: getResource: /resources/ezcomp/level2_background.jpg
          INFO: getResource: /resources/ezcomp/level2_deselect.jpg
          INFO: getResource: /resources/ezcomp/level2_selected-left.jpg
          INFO: getResource: /resources/ezcomp/level2_selected-middle.jpg
          INFO: getResource: /resources/ezcomp/level2_selected-right.jpg
          INFO: getResource: /resources/ezcomp/level2_selected.gif
          INFO: getResource: /resources/ezcomp/level2_selected.jpg
          INFO: getResource: /resources/ezcomp/level3_background.gif
          INFO: getResource: /resources/ezcomp/level3_deselect.jpg
          INFO: getResource: /resources/ezcomp/level3_selected.jpg
          INFO: getResource: /resources/ezcomp/lite_column_hdr_gradient.gif
          INFO: getResource: /resources/ezcomp/lite_column_hdr_hov_gradient.gif
          INFO: getResource: /resources/ezcomp/lite_column_hdr_sort_gradient.gif
          INFO: getResource: /resources/ezcomp/lite_column_hdr_sort_hov_gradient.gif
          INFO: getResource: /resources/ezcomp/login-backimage.jpg
          INFO: getResource: /resources/ezcomp/loginPanel.groovy
          INFO: getResource: /resources/ezcomp/loginPanel.properties
          INFO: getResource: /resources/ezcomp/loginPanel.xhtml
          INFO: getResource: /resources/ezcomp/masthead-background.jpg
          INFO: getResource: /resources/ezcomp/masthead-sun-background.jpg
          INFO: getResource: /resources/ezcomp/masthead_button.gif
          INFO: getResource: /resources/ezcomp/masthead_button_over.gif
          INFO: getResource: /resources/ezcomp/masthead_link_enabled.gif
          INFO: getResource: /resources/ezcomp/masthead_link_roll.gif
          INFO: getResource: /resources/ezcomp/minitab_background.jpg
          INFO: getResource: /resources/ezcomp/minitab_deselect.jpg
          INFO: getResource: /resources/ezcomp/minitab_selected.jpg
          INFO: getResource: /resources/ezcomp/mult_column_hdr_sort_gradient.gif
          INFO: getResource: /resources/ezcomp/primary-disabled.gif
          INFO: getResource: /resources/ezcomp/primary-enabled.gif
          INFO: getResource: /resources/ezcomp/primary-mini-enabled.gif
          INFO: getResource: /resources/ezcomp/primary-mini-roll.gif
          INFO: getResource: /resources/ezcomp/primary-roll.gif
          INFO: getResource: /resources/ezcomp/progressBar.css
          INFO: getResource: /resources/ezcomp/reg-slice.gif
          INFO: getResource: /resources/ezcomp/rightBottom.gif
          INFO: getResource: /resources/ezcomp/rightTop.gif
          INFO: getResource: /resources/ezcomp/s-curve.gif
          INFO: getResource: /resources/ezcomp/sec-masthead-background.jpg
          INFO: getResource: /resources/ezcomp/secondary-disabled.gif
          INFO: getResource: /resources/ezcomp/secondary-enabled.gif
          INFO: getResource: /resources/ezcomp/secondary-mini-enabled.gif
          INFO: getResource: /resources/ezcomp/secondary-mini-roll.gif
          INFO: getResource: /resources/ezcomp/secondary-roll.gif
          INFO: getResource: /resources/ezcomp/still-indeterminate.gif
          INFO: getResource: /resources/ezcomp/table2.css
          INFO: getResource: /resources/ezcomp/table_titlebar_gradient.gif
          INFO: getResource: /resources/ezcomp/tipbackground.gif
          INFO: getResource: /resources/ezcomp/typography.css
          INFO: getResource: /resources/ezcomp/version_brand.jpg
          INFO: getResource: /resources/ezcomp/wizbdy_minitab_background.jpg

          Add to the above the use of ExternalContext.getResource() to determine the existence of a view for conditional navigation, and you have a good idea of all the places that need to be touched to accommodate this new API.

          Show
          Ed Burns added a comment - As evidence of the problem listed in the summary of the bug: 3. It makes it difficult to distinguish between requests for view ids vs. other types of resources. Consider this ad hoc log output from getResource(): INFO: getResource: /index.xhtml INFO: getResource: /resources/compositeTest/foo.xhtml INFO: getResource: /resources/ezcomp/LoginProductName.png INFO: getResource: /resources/ezcomp/add-rem_header.gif INFO: getResource: /resources/ezcomp/alertbackground_bottom_left.gif INFO: getResource: /resources/ezcomp/alertbackground_bottom_right.gif INFO: getResource: /resources/ezcomp/alertbackground_middle.gif INFO: getResource: /resources/ezcomp/alertbackground_top.gif INFO: getResource: /resources/ezcomp/alertbackground_top_left.gif INFO: getResource: /resources/ezcomp/alertbackground_top_right.gif INFO: getResource: /resources/ezcomp/background_border_bottom.gif INFO: getResource: /resources/ezcomp/bg_gradient.gif INFO: getResource: /resources/ezcomp/bg_gradient_disabled.gif INFO: getResource: /resources/ezcomp/bg_gradient_selected.gif INFO: getResource: /resources/ezcomp/bkgrnd.gif INFO: getResource: /resources/ezcomp/calpop_dropshadow.png INFO: getResource: /resources/ezcomp/calpop_footer_grad.gif INFO: getResource: /resources/ezcomp/colorAndMedia.css INFO: getResource: /resources/ezcomp/column_hdr_gradient.gif INFO: getResource: /resources/ezcomp/column_hdr_hov_gradient.gif INFO: getResource: /resources/ezcomp/column_hdr_sort_gradient.gif INFO: getResource: /resources/ezcomp/column_hdr_sort_hov_gradient.gif INFO: getResource: /resources/ezcomp/commontaskssection.css INFO: getResource: /resources/ezcomp/componentWithBackingJavaClass.groovy INFO: getResource: /resources/ezcomp/componentWithBackingJavaClass.xhtml INFO: getResource: /resources/ezcomp/css_master.css INFO: getResource: /resources/ezcomp/css_ns6up.css INFO: getResource: /resources/ezcomp/date_time_gradient.jpg INFO: getResource: /resources/ezcomp/dot.gif INFO: getResource: /resources/ezcomp/failed_small.gif INFO: getResource: /resources/ezcomp/grad1.gif INFO: getResource: /resources/ezcomp/grad2.gif INFO: getResource: /resources/ezcomp/gradation-grey.gif INFO: getResource: /resources/ezcomp/gradlogbot.jpg INFO: getResource: /resources/ezcomp/gradlogsides.jpg INFO: getResource: /resources/ezcomp/gradlogtop.jpg INFO: getResource: /resources/ezcomp/gradtblhdr.gif INFO: getResource: /resources/ezcomp/gradtblhdrsrt.gif INFO: getResource: /resources/ezcomp/gradtblttl.jpg INFO: getResource: /resources/ezcomp/grouprow_gradient.gif INFO: getResource: /resources/ezcomp/header-short.gif INFO: getResource: /resources/ezcomp/help_btnnav_gradient.jpg INFO: getResource: /resources/ezcomp/indeterminate.gif INFO: getResource: /resources/ezcomp/layout.css INFO: getResource: /resources/ezcomp/left-pane-background.gif INFO: getResource: /resources/ezcomp/leftBottom.gif INFO: getResource: /resources/ezcomp/leftTop.gif INFO: getResource: /resources/ezcomp/left_pane_grad.jpg INFO: getResource: /resources/ezcomp/level1_background.jpg INFO: getResource: /resources/ezcomp/level1_deselect.jpg INFO: getResource: /resources/ezcomp/level1_selected-1lev.jpg INFO: getResource: /resources/ezcomp/level1_selected-1lvl.jpg INFO: getResource: /resources/ezcomp/level1_selected-left.jpg INFO: getResource: /resources/ezcomp/level1_selected-middle.jpg INFO: getResource: /resources/ezcomp/level1_selected-right.jpg INFO: getResource: /resources/ezcomp/level1_selected.jpg INFO: getResource: /resources/ezcomp/level2_background.jpg INFO: getResource: /resources/ezcomp/level2_deselect.jpg INFO: getResource: /resources/ezcomp/level2_selected-left.jpg INFO: getResource: /resources/ezcomp/level2_selected-middle.jpg INFO: getResource: /resources/ezcomp/level2_selected-right.jpg INFO: getResource: /resources/ezcomp/level2_selected.gif INFO: getResource: /resources/ezcomp/level2_selected.jpg INFO: getResource: /resources/ezcomp/level3_background.gif INFO: getResource: /resources/ezcomp/level3_deselect.jpg INFO: getResource: /resources/ezcomp/level3_selected.jpg INFO: getResource: /resources/ezcomp/lite_column_hdr_gradient.gif INFO: getResource: /resources/ezcomp/lite_column_hdr_hov_gradient.gif INFO: getResource: /resources/ezcomp/lite_column_hdr_sort_gradient.gif INFO: getResource: /resources/ezcomp/lite_column_hdr_sort_hov_gradient.gif INFO: getResource: /resources/ezcomp/login-backimage.jpg INFO: getResource: /resources/ezcomp/loginPanel.groovy INFO: getResource: /resources/ezcomp/loginPanel.properties INFO: getResource: /resources/ezcomp/loginPanel.xhtml INFO: getResource: /resources/ezcomp/masthead-background.jpg INFO: getResource: /resources/ezcomp/masthead-sun-background.jpg INFO: getResource: /resources/ezcomp/masthead_button.gif INFO: getResource: /resources/ezcomp/masthead_button_over.gif INFO: getResource: /resources/ezcomp/masthead_link_enabled.gif INFO: getResource: /resources/ezcomp/masthead_link_roll.gif INFO: getResource: /resources/ezcomp/minitab_background.jpg INFO: getResource: /resources/ezcomp/minitab_deselect.jpg INFO: getResource: /resources/ezcomp/minitab_selected.jpg INFO: getResource: /resources/ezcomp/mult_column_hdr_sort_gradient.gif INFO: getResource: /resources/ezcomp/primary-disabled.gif INFO: getResource: /resources/ezcomp/primary-enabled.gif INFO: getResource: /resources/ezcomp/primary-mini-enabled.gif INFO: getResource: /resources/ezcomp/primary-mini-roll.gif INFO: getResource: /resources/ezcomp/primary-roll.gif INFO: getResource: /resources/ezcomp/progressBar.css INFO: getResource: /resources/ezcomp/reg-slice.gif INFO: getResource: /resources/ezcomp/rightBottom.gif INFO: getResource: /resources/ezcomp/rightTop.gif INFO: getResource: /resources/ezcomp/s-curve.gif INFO: getResource: /resources/ezcomp/sec-masthead-background.jpg INFO: getResource: /resources/ezcomp/secondary-disabled.gif INFO: getResource: /resources/ezcomp/secondary-enabled.gif INFO: getResource: /resources/ezcomp/secondary-mini-enabled.gif INFO: getResource: /resources/ezcomp/secondary-mini-roll.gif INFO: getResource: /resources/ezcomp/secondary-roll.gif INFO: getResource: /resources/ezcomp/still-indeterminate.gif INFO: getResource: /resources/ezcomp/table2.css INFO: getResource: /resources/ezcomp/table_titlebar_gradient.gif INFO: getResource: /resources/ezcomp/tipbackground.gif INFO: getResource: /resources/ezcomp/typography.css INFO: getResource: /resources/ezcomp/version_brand.jpg INFO: getResource: /resources/ezcomp/wizbdy_minitab_background.jpg Add to the above the use of ExternalContext.getResource() to determine the existence of a view for conditional navigation, and you have a good idea of all the places that need to be touched to accommodate this new API.
          Ed Burns logged work - 24/Feb/12 9:12 PM
          • Time Spent:
            2 hours
             
            <No comment>
          Ed Burns made changes -
          Remaining Estimate 0 minutes [ 0 ]
          Time Spent 2 hours [ 7200 ]
          Hide
          Ed Burns added a comment -

          Callpaths to ExternalContext.getResource()

          Usage1: During RestoreViewPhase when trying to load a page to get its
          <f:metadata> section.

          csf.context.ExternalContextImpl.getResource(ExternalContextImpl.java:527)
          csf.fclts.util.Resource.getResourceUrl(Resource.java:106)
          csf.fclts.impl.DefaultResourceResolver.resolveUrl(DefaultResourceResolver.java:77)
          csf.fclts.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:252)
          csf.fclts.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:295)
          csf.fclts.impl.DefaultFaceletFactory.getMetadataFacelet(DefaultFaceletFactory.java:231)
          csf.appl.view.ViewMetadataImpl.createMetadataView(ViewMetadataImpl.java:114)
          csf.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:241)
          csf.lifecycle.Phase.doPhase(Phase.java:101)
          csf.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:122)
          csf.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:158)
          javax.faces.webapp.FacesServlet.service(FacesServlet.java:640)

          Usage2: When trying to render a button whose action uses conditional
          navigation.

          csf.context.ExternalContextImpl.getResource(ExternalContextImpl.java:527)
          csf.fclts.util.Resource.getResourceUrl(Resource.java:106)
          csf.fclts.impl.DefaultResourceResolver.resolveUrl(DefaultResourceResolver.java:77)
          csf.appl.view.FaceletViewHandlingStrategy.viewExists(FaceletViewHandlingStrategy.java:799)
          csf.appl.view.MultiViewHandler.derivePhysicalViewId(MultiViewHandler.java:564)
          csf.appl.view.MultiViewHandler.deriveViewId(MultiViewHandler.java:451)
          csf.appl.NavigationHandlerImpl.findImplicitMatch(NavigationHandlerImpl.java:557)
          csf.appl.NavigationHandlerImpl.getViewId(NavigationHandlerImpl.java:309)
          csf.appl.NavigationHandlerImpl.getNavigationCase(NavigationHandlerImpl.java:125)
          csf.systest.implicitnav.ImplicitNavigationBean.getCurrentActionUrl(ImplicitNavigationBean.java:59)
          sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java)
          sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          java.lang.reflect.Method.invoke(Method.java:597)
          javax.el.BeanELResolver.getValue(BeanELResolver.java:363)
          csf.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
          csf.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
          com.sun.el.parser.AstValue.getValue(AstValue.java:138)
          com.sun.el.parser.AstValue.getValue(AstValue.java:183)
          com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:224)
          csf.fclts.el.TagValueExpression.getValue(TagValueExpression.java:109)
          javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
          javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
          javax.faces.component.UIOutput.getValue(UIOutput.java:169)
          csf.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205)
          csf.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:355)
          csf.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164)
          javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
          javax.faces.component.UIComponent.encodeAll(UIComponent.java:1799)
          javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
          javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
          javax.faces.component.UIComponent.encodeAll(UIComponent.java:1792)
          javax.faces.component.UIComponent.encodeAll(UIComponent.java:1795)
          javax.faces.component.UIComponent.encodeAll(UIComponent.java:1795)
          csf.appl.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)
          csf.appl.view.MultiViewHandler.renderView(MultiViewHandler.java:127)
          csf.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
          csf.lifecycle.Phase.doPhase(Phase.java:101)
          csf.lifecycle.LifecycleImpl.render(LifecycleImpl.java:179)
          javax.faces.webapp.FacesServlet.service(FacesServlet.java:641)

          Usage3: When trying to get the viewId on an initial page request.

          csf.context.ExternalContextImpl.getResource(ExternalContextImpl.java:528)
          csf.fclts.util.Resource.getResourceUrl(Resource.java:106)
          csf.fclts.impl.DefaultResourceResolver.resolveUrl(DefaultResourceResolver.java:77)
          csf.appl.view.FaceletViewHandlingStrategy.viewExists(FaceletViewHandlingStrategy.java:799)
          csf.appl.view.MultiViewHandler.convertViewId(MultiViewHandler.java:527)
          csf.appl.view.MultiViewHandler.derivePhysicalViewId(MultiViewHandler.java:547)
          csf.appl.view.MultiViewHandler.deriveLogicalViewId(MultiViewHandler.java:458)
          csf.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:229)
          csf.lifecycle.Phase.doPhase(Phase.java:101)
          csf.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:122)
          csf.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:158)
          javax.faces.webapp.FacesServlet.service(FacesServlet.java:640)

          Usage4: When trying to serve up a resource request from the filesystem.

          csf.context.ExternalContextImpl.getResource(ExternalContextImpl.java:528)
          csf.appl.resource.WebappResourceHelper.findResource(WebappResourceHelper.java:185)
          csf.appl.resource.ResourceManager.findResource(ResourceManager.java:419)
          csf.appl.resource.ResourceManager.doLookup(ResourceManager.java:248)
          csf.appl.resource.ResourceManager.findResource(ResourceManager.java:185)
          csf.appl.resource.ResourceHandlerImpl.createResource(ResourceHandlerImpl.java:172)
          csf.appl.resource.ResourceHandlerImpl.createResource(ResourceHandlerImpl.java:152)
          csf.fclts.tag.jsf.CompositeComponentTagLibrary.getCompositeComponentResource(CompositeComponentTagLibrary.java:155)
          csf.fclts.tag.jsf.CompositeComponentTagLibrary.containsTagHandler(CompositeComponentTagLibrary.java:121)
          csf.fclts.tag.CompositeTagLibrary.containsTagHandler(CompositeTagLibrary.java:177)
          csf.fclts.compiler.CompilationManager.pushTag(CompilationManager.java:295)
          csf.fclts.compiler.SAXCompiler$CompilationHandler.startElement(SAXCompiler.java:266)
          com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
          com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:767)
          com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
          com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2756)
          com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
          com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
          com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
          com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
          com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
          com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
          com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
          com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
          javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
          javax.xml.parsers.SAXParser.parse(SAXParser.java:198)
          csf.fclts.compiler.SAXCompiler.doCompile(SAXCompiler.java:434)
          csf.fclts.compiler.SAXCompiler.doCompile(SAXCompiler.java:410)
          csf.fclts.compiler.Compiler.compile(Compiler.java:124)
          csf.fclts.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:401)
          csf.fclts.impl.DefaultFaceletFactory.access$100(DefaultFaceletFactory.java:102)
          csf.fclts.impl.DefaultFaceletFactory$1.newInstance(DefaultFaceletFactory.java:183)
          csf.fclts.impl.DefaultFaceletFactory$1.newInstance(DefaultFaceletFactory.java:181)
          csf.fclts.impl.DefaultFaceletCache$1.newInstance(DefaultFaceletCache.java:83)
          csf.fclts.impl.DefaultFaceletCache$1.newInstance(DefaultFaceletCache.java:78)
          csf.util.ExpiringConcurrentCache$1.call(ExpiringConcurrentCache.java:99)
          java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          java.util.concurrent.FutureTask.run(FutureTask.java:138)
          csf.util.ExpiringConcurrentCache.get(ExpiringConcurrentCache.java:114)
          csf.fclts.impl.DefaultFaceletCache.getFacelet(DefaultFaceletCache.java:121)
          csf.fclts.impl.DefaultFaceletCache.getFacelet(DefaultFaceletCache.java:62)
          csf.fclts.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:278)
          csf.fclts.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:223)
          csf.appl.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:768)
          csf.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
          csf.lifecycle.Phase.doPhase(Phase.java:101)
          csf.lifecycle.LifecycleImpl.render(LifecycleImpl.java:179)
          javax.faces.webapp.FacesServlet.service(FacesServlet.java:641)

          Usage5: When trying to find a ScriptComponent Resource for a Composite
          Component.

          csf.context.ExternalContextImpl.getResource(ExternalContextImpl.java:527)
          csf.appl.resource.WebappResourceHelper.findResource(WebappResourceHelper.java:185)
          csf.appl.resource.ResourceManager.findResource(ResourceManager.java:419)
          csf.appl.resource.ResourceManager.doLookup(ResourceManager.java:248)
          csf.appl.resource.ResourceManager.findResource(ResourceManager.java:185)
          csf.appl.resource.ResourceHandlerImpl.createResource(ResourceHandlerImpl.java:172)
          csf.appl.resource.ResourceHandlerImpl.createResource(ResourceHandlerImpl.java:152)
          csf.appl.view.FaceletViewHandlingStrategy.getScriptComponentResource(FaceletViewHandlingStrategy.java:340)
          csf.appl.applImpl.createComponent(ApplicationImpl.java:962)
          csf.fclts.tag.jsf.CompositeComponentTagHandler.createComponent(CompositeComponentTagHandler.java:165)
          csf.fclts.tag.jsf.ComponentTagHandlerDelegateImpl.createComponent(ComponentTagHandlerDelegateImpl.java:500)
          csf.fclts.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:157)
          javax.faces.view.fclts.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
          javax.faces.view.fclts.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
          javax.faces.view.fclts.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
          csf.fclts.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
          javax.faces.view.fclts.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
          javax.faces.view.fclts.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
          javax.faces.view.fclts.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
          csf.fclts.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
          javax.faces.view.fclts.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
          javax.faces.view.fclts.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
          csf.fclts.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
          javax.faces.view.fclts.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
          csf.fclts.compiler.EncodingHandler.apply(EncodingHandler.java:86)
          csf.fclts.impl.DefaultFacelet.apply(DefaultFacelet.java:152)
          csf.appl.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:774)
          csf.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
          csf.lifecycle.Phase.doPhase(Phase.java:101)
          csf.lifecycle.LifecycleImpl.render(LifecycleImpl.java:179)
          javax.faces.webapp.FacesServlet.service(FacesServlet.java:641)

          Usage6: When trying to render out the markup for a stylesheet reference
          in the HEAD.

          csf.context.ExternalContextImpl.getResource(ExternalContextImpl.java:527)
          csf.appl.resource.WebappResourceHelper.findResource(WebappResourceHelper.java:185)
          csf.appl.resource.ResourceManager.findResource(ResourceManager.java:419)
          csf.appl.resource.ResourceManager.doLookup(ResourceManager.java:248)
          csf.appl.resource.ResourceManager.findResource(ResourceManager.java:185)
          csf.appl.resource.ResourceHandlerImpl.createResource(ResourceHandlerImpl.java:172)
          csf.appl.resource.ResourceHandlerImpl.createResource(ResourceHandlerImpl.java:152)
          csf.renderkit.html_basic.StylesheetRenderer.encodeEnd(StylesheetRenderer.java:97)
          javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
          javax.faces.component.UIComponent.encodeAll(UIComponent.java:1799)
          csf.renderkit.html_basic.HeadRenderer.encodeHeadResources(HeadRenderer.java:105)
          csf.renderkit.html_basic.HeadRenderer.encodeEnd(HeadRenderer.java:92)
          javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
          javax.faces.component.UIComponent.encodeAll(UIComponent.java:1799)
          javax.faces.component.UIComponent.encodeAll(UIComponent.java:1795)
          csf.appl.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)
          csf.appl.view.MultiViewHandler.renderView(MultiViewHandler.java:127)
          csf.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
          csf.lifecycle.Phase.doPhase(Phase.java:101)
          csf.lifecycle.LifecycleImpl.render(LifecycleImpl.java:179)
          javax.faces.webapp.FacesServlet.service(FacesServlet.java:641)

          Show
          Ed Burns added a comment - Callpaths to ExternalContext.getResource() Usage1: During RestoreViewPhase when trying to load a page to get its <f:metadata> section. csf.context.ExternalContextImpl.getResource(ExternalContextImpl.java:527) csf.fclts.util.Resource.getResourceUrl(Resource.java:106) csf.fclts.impl.DefaultResourceResolver.resolveUrl(DefaultResourceResolver.java:77) csf.fclts.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:252) csf.fclts.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:295) csf.fclts.impl.DefaultFaceletFactory.getMetadataFacelet(DefaultFaceletFactory.java:231) csf.appl.view.ViewMetadataImpl.createMetadataView(ViewMetadataImpl.java:114) csf.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:241) csf.lifecycle.Phase.doPhase(Phase.java:101) csf.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:122) csf.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:158) javax.faces.webapp.FacesServlet.service(FacesServlet.java:640) Usage2: When trying to render a button whose action uses conditional navigation. csf.context.ExternalContextImpl.getResource(ExternalContextImpl.java:527) csf.fclts.util.Resource.getResourceUrl(Resource.java:106) csf.fclts.impl.DefaultResourceResolver.resolveUrl(DefaultResourceResolver.java:77) csf.appl.view.FaceletViewHandlingStrategy.viewExists(FaceletViewHandlingStrategy.java:799) csf.appl.view.MultiViewHandler.derivePhysicalViewId(MultiViewHandler.java:564) csf.appl.view.MultiViewHandler.deriveViewId(MultiViewHandler.java:451) csf.appl.NavigationHandlerImpl.findImplicitMatch(NavigationHandlerImpl.java:557) csf.appl.NavigationHandlerImpl.getViewId(NavigationHandlerImpl.java:309) csf.appl.NavigationHandlerImpl.getNavigationCase(NavigationHandlerImpl.java:125) csf.systest.implicitnav.ImplicitNavigationBean.getCurrentActionUrl(ImplicitNavigationBean.java:59) sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) javax.el.BeanELResolver.getValue(BeanELResolver.java:363) csf.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) csf.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) com.sun.el.parser.AstValue.getValue(AstValue.java:138) com.sun.el.parser.AstValue.getValue(AstValue.java:183) com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:224) csf.fclts.el.TagValueExpression.getValue(TagValueExpression.java:109) javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194) javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182) javax.faces.component.UIOutput.getValue(UIOutput.java:169) csf.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205) csf.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:355) csf.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164) javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1799) javax.faces.render.Renderer.encodeChildren(Renderer.java:168) javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1792) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1795) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1795) csf.appl.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402) csf.appl.view.MultiViewHandler.renderView(MultiViewHandler.java:127) csf.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) csf.lifecycle.Phase.doPhase(Phase.java:101) csf.lifecycle.LifecycleImpl.render(LifecycleImpl.java:179) javax.faces.webapp.FacesServlet.service(FacesServlet.java:641) Usage3: When trying to get the viewId on an initial page request. csf.context.ExternalContextImpl.getResource(ExternalContextImpl.java:528) csf.fclts.util.Resource.getResourceUrl(Resource.java:106) csf.fclts.impl.DefaultResourceResolver.resolveUrl(DefaultResourceResolver.java:77) csf.appl.view.FaceletViewHandlingStrategy.viewExists(FaceletViewHandlingStrategy.java:799) csf.appl.view.MultiViewHandler.convertViewId(MultiViewHandler.java:527) csf.appl.view.MultiViewHandler.derivePhysicalViewId(MultiViewHandler.java:547) csf.appl.view.MultiViewHandler.deriveLogicalViewId(MultiViewHandler.java:458) csf.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:229) csf.lifecycle.Phase.doPhase(Phase.java:101) csf.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:122) csf.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:158) javax.faces.webapp.FacesServlet.service(FacesServlet.java:640) Usage4: When trying to serve up a resource request from the filesystem. csf.context.ExternalContextImpl.getResource(ExternalContextImpl.java:528) csf.appl.resource.WebappResourceHelper.findResource(WebappResourceHelper.java:185) csf.appl.resource.ResourceManager.findResource(ResourceManager.java:419) csf.appl.resource.ResourceManager.doLookup(ResourceManager.java:248) csf.appl.resource.ResourceManager.findResource(ResourceManager.java:185) csf.appl.resource.ResourceHandlerImpl.createResource(ResourceHandlerImpl.java:172) csf.appl.resource.ResourceHandlerImpl.createResource(ResourceHandlerImpl.java:152) csf.fclts.tag.jsf.CompositeComponentTagLibrary.getCompositeComponentResource(CompositeComponentTagLibrary.java:155) csf.fclts.tag.jsf.CompositeComponentTagLibrary.containsTagHandler(CompositeComponentTagLibrary.java:121) csf.fclts.tag.CompositeTagLibrary.containsTagHandler(CompositeTagLibrary.java:177) csf.fclts.compiler.CompilationManager.pushTag(CompilationManager.java:295) csf.fclts.compiler.SAXCompiler$CompilationHandler.startElement(SAXCompiler.java:266) com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501) com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:767) com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400) com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2756) com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) javax.xml.parsers.SAXParser.parse(SAXParser.java:395) javax.xml.parsers.SAXParser.parse(SAXParser.java:198) csf.fclts.compiler.SAXCompiler.doCompile(SAXCompiler.java:434) csf.fclts.compiler.SAXCompiler.doCompile(SAXCompiler.java:410) csf.fclts.compiler.Compiler.compile(Compiler.java:124) csf.fclts.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:401) csf.fclts.impl.DefaultFaceletFactory.access$100(DefaultFaceletFactory.java:102) csf.fclts.impl.DefaultFaceletFactory$1.newInstance(DefaultFaceletFactory.java:183) csf.fclts.impl.DefaultFaceletFactory$1.newInstance(DefaultFaceletFactory.java:181) csf.fclts.impl.DefaultFaceletCache$1.newInstance(DefaultFaceletCache.java:83) csf.fclts.impl.DefaultFaceletCache$1.newInstance(DefaultFaceletCache.java:78) csf.util.ExpiringConcurrentCache$1.call(ExpiringConcurrentCache.java:99) java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) java.util.concurrent.FutureTask.run(FutureTask.java:138) csf.util.ExpiringConcurrentCache.get(ExpiringConcurrentCache.java:114) csf.fclts.impl.DefaultFaceletCache.getFacelet(DefaultFaceletCache.java:121) csf.fclts.impl.DefaultFaceletCache.getFacelet(DefaultFaceletCache.java:62) csf.fclts.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:278) csf.fclts.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:223) csf.appl.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:768) csf.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100) csf.lifecycle.Phase.doPhase(Phase.java:101) csf.lifecycle.LifecycleImpl.render(LifecycleImpl.java:179) javax.faces.webapp.FacesServlet.service(FacesServlet.java:641) Usage5: When trying to find a ScriptComponent Resource for a Composite Component. csf.context.ExternalContextImpl.getResource(ExternalContextImpl.java:527) csf.appl.resource.WebappResourceHelper.findResource(WebappResourceHelper.java:185) csf.appl.resource.ResourceManager.findResource(ResourceManager.java:419) csf.appl.resource.ResourceManager.doLookup(ResourceManager.java:248) csf.appl.resource.ResourceManager.findResource(ResourceManager.java:185) csf.appl.resource.ResourceHandlerImpl.createResource(ResourceHandlerImpl.java:172) csf.appl.resource.ResourceHandlerImpl.createResource(ResourceHandlerImpl.java:152) csf.appl.view.FaceletViewHandlingStrategy.getScriptComponentResource(FaceletViewHandlingStrategy.java:340) csf.appl.applImpl.createComponent(ApplicationImpl.java:962) csf.fclts.tag.jsf.CompositeComponentTagHandler.createComponent(CompositeComponentTagHandler.java:165) csf.fclts.tag.jsf.ComponentTagHandlerDelegateImpl.createComponent(ComponentTagHandlerDelegateImpl.java:500) csf.fclts.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:157) javax.faces.view.fclts.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) javax.faces.view.fclts.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98) javax.faces.view.fclts.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) csf.fclts.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184) javax.faces.view.fclts.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) javax.faces.view.fclts.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98) javax.faces.view.fclts.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) csf.fclts.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184) javax.faces.view.fclts.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) javax.faces.view.fclts.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98) csf.fclts.compiler.NamespaceHandler.apply(NamespaceHandler.java:93) javax.faces.view.fclts.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98) csf.fclts.compiler.EncodingHandler.apply(EncodingHandler.java:86) csf.fclts.impl.DefaultFacelet.apply(DefaultFacelet.java:152) csf.appl.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:774) csf.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100) csf.lifecycle.Phase.doPhase(Phase.java:101) csf.lifecycle.LifecycleImpl.render(LifecycleImpl.java:179) javax.faces.webapp.FacesServlet.service(FacesServlet.java:641) Usage6: When trying to render out the markup for a stylesheet reference in the HEAD. csf.context.ExternalContextImpl.getResource(ExternalContextImpl.java:527) csf.appl.resource.WebappResourceHelper.findResource(WebappResourceHelper.java:185) csf.appl.resource.ResourceManager.findResource(ResourceManager.java:419) csf.appl.resource.ResourceManager.doLookup(ResourceManager.java:248) csf.appl.resource.ResourceManager.findResource(ResourceManager.java:185) csf.appl.resource.ResourceHandlerImpl.createResource(ResourceHandlerImpl.java:172) csf.appl.resource.ResourceHandlerImpl.createResource(ResourceHandlerImpl.java:152) csf.renderkit.html_basic.StylesheetRenderer.encodeEnd(StylesheetRenderer.java:97) javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1799) csf.renderkit.html_basic.HeadRenderer.encodeHeadResources(HeadRenderer.java:105) csf.renderkit.html_basic.HeadRenderer.encodeEnd(HeadRenderer.java:92) javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1799) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1795) csf.appl.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402) csf.appl.view.MultiViewHandler.renderView(MultiViewHandler.java:127) csf.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) csf.lifecycle.Phase.doPhase(Phase.java:101) csf.lifecycle.LifecycleImpl.render(LifecycleImpl.java:179) javax.faces.webapp.FacesServlet.service(FacesServlet.java:641)
          Ed Burns made changes -
          lamine_ba made changes -
          Comment [ if we treat a view like a resource, The external context cannot be the only resolver in the case of :

          1) I have additionnal repositories
          2) I'm scaling in my JSF application and want to avoid the resources duplication by having an external and central repository.
          ....
          ....

          One solution could be to have a chain of resource resolvers where the external context will be the last.

          {code}
          public interface ResourceResolver {
              Resource getResource(String location);
          }
          {code}

          this interface is similar to Spring ResourceLoader (http://static.springsource.org/spring/docs/2.5.x/reference/resources.html)

          Let's try to find the elements that could be in the chain.

          - the External Context

          {code}
          public abstract class ExternalContext implements ResourceResolver {
          public Resource getResource(String location) {
                }
          }
          {code}

          - ModuleManager ( Lay the groundwork for application modules – a set of views, images, stylesheets, etc., inside of a JAR file)

          Issue : http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-532

          {code}
          public class ModuleManager extends PluginManager<Module> {
          }
          {code}

          - Multi-templating System : http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-971

          {code}
          public class TemplateManager extends PluginManager<Template> {
          }
          {code}

          Plugin System : http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-970

          {code}
          public abstract class PluginManager<T extends Plugin> implements ResourceResolver {

           public Resource getResource(String name) {
          return folder.getDocument(name);
               }
          }
          {code}

          The ResourceHandler could be the entry point to add a new resolver and to resolve a Resource. ]
          lamine_ba made changes -
          Comment [ Yes Kito it'd make sense to unify the resource-handling mechanism.


          (3) Allow views (or sets of views) to be versioned and localized
          (4) Lay the groundwork for application modules – a set of views, images, stylesheets, etc., inside of a JAR file.


          Every JSF application has a front end and a back end. Once we have this issue resolved http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-532, One can create some modules for our back end to ease the development and the management of a JSF application. We don't need anymore eclipse, netbeans to have our tools.


          (1) Provide the ability to load Facelet views from a JAR without writing a custom class.

          Thus I can bring default facelets views you can customize if they don't meet your needs



          (2) Provide a single entry point for customizing resource resolution and view resolution.

          A view is nothing more than a Resource, why do we have this mismatch? If resources are stored in different locations, it is fairly impossible to aggregate and resolve them if we don't have a single entry point where we can reach the other points.
          ]
          lamine_ba made changes -
          Comment [ Related issues:

          The Resource class should be an interface : http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-986 ]
          lamine_ba made changes -
          Comment [ Related issues:

          Need method to map viewId to resource path : http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-719 ]
          Hide
          Ed Burns added a comment -

          Spoke to Kito Mann today. It emerged that it might make sense to leverage the ResourceHandler (fixing its many problems first) for this purpose.

          This might make it possible to deprecated the Facelets ResourceResolver.

          Show
          Ed Burns added a comment - Spoke to Kito Mann today. It emerged that it might make sense to leverage the ResourceHandler (fixing its many problems first) for this purpose. This might make it possible to deprecated the Facelets ResourceResolver.
          Ed Burns made changes -
          Assignee rogerk [ rogerk ] Ed Burns [ edburns ]
          Hide
          Ed Burns added a comment -

          Sending jsf-api/src/main/java/javax/faces/application/ResourceHandler.java
          Sending jsf-api/src/main/java/javax/faces/application/ResourceHandlerWrapper.java
          Sending jsf-api/src/main/java/javax/faces/view/ViewDeclarationLanguage.java
          Sending jsf-api/src/main/java/javax/faces/view/facelets/FaceletFactory.java
          Sending jsf-api/src/main/java/javax/faces/view/facelets/FaceletFactoryWrapper.java
          Sending jsf-api/src/main/java/javax/faces/view/facelets/ResourceResolver.java
          Sending jsf-ri/src/main/java/com/sun/faces/application/resource/ResourceHandlerImpl.java
          Sending jsf-ri/src/main/java/com/sun/faces/application/view/FaceletViewHandlingStrategy.java
          Sending jsf-ri/src/main/java/com/sun/faces/facelets/impl/DefaultFaceletFactory.java
          Sending jsf-ri/src/main/java/com/sun/faces/facelets/impl/DefaultResourceResolver.java
          Transmitting file data ..........
          Committed revision 9755.

          Show
          Ed Burns added a comment - Sending jsf-api/src/main/java/javax/faces/application/ResourceHandler.java Sending jsf-api/src/main/java/javax/faces/application/ResourceHandlerWrapper.java Sending jsf-api/src/main/java/javax/faces/view/ViewDeclarationLanguage.java Sending jsf-api/src/main/java/javax/faces/view/facelets/FaceletFactory.java Sending jsf-api/src/main/java/javax/faces/view/facelets/FaceletFactoryWrapper.java Sending jsf-api/src/main/java/javax/faces/view/facelets/ResourceResolver.java Sending jsf-ri/src/main/java/com/sun/faces/application/resource/ResourceHandlerImpl.java Sending jsf-ri/src/main/java/com/sun/faces/application/view/FaceletViewHandlingStrategy.java Sending jsf-ri/src/main/java/com/sun/faces/facelets/impl/DefaultFaceletFactory.java Sending jsf-ri/src/main/java/com/sun/faces/facelets/impl/DefaultResourceResolver.java Transmitting file data .......... Committed revision 9755.
          Ed Burns made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 2.2 Sprint 11 B [ 15573 ]
          Fix Version/s 2.2 [ 10403 ]
          Resolution Fixed [ 1 ]
          Hide
          arjan tijms added a comment -

          Regarding #3… ExternalContext.getResource() may be used for all sorts of resources. In our case we
          only want to search our external repositories when a view id is requested, but not, say, when someone
          calls getResource() to load some other type of file (eg. a style sheet).

          I know the issue is resolved and closed, but I'm just wondering about the original intend.

          The description makes it sound like ExternalContext.getResource() has to be overridden in addition to providing a ResourceResolver to fully support loading views from another location. Supposedly implicit navigation directly called ExternalContext.getResource().

          But, this is not what happens at all in JSF 2.1.

          Implicit navigation and all other cases that need to interact with the physical location of the view already go through the ResourceResolver. This is clear from the stacktraces Ed posted on 24/Feb/12 09:13 PM

          So, in order to satisfy "we only want to search our external repositories when a view id is requested", the existing ResourceResolver already fully did the job and "2. It requires hooking into multiple locations." doesn't apply.

          Maybe I'm completely missing something though.

          The new mechanism does seem inline with the comment made by kito on 19/Apr/11

          Show
          arjan tijms added a comment - Regarding #3… ExternalContext.getResource() may be used for all sorts of resources. In our case we only want to search our external repositories when a view id is requested, but not, say, when someone calls getResource() to load some other type of file (eg. a style sheet). I know the issue is resolved and closed, but I'm just wondering about the original intend. The description makes it sound like ExternalContext.getResource() has to be overridden in addition to providing a ResourceResolver to fully support loading views from another location. Supposedly implicit navigation directly called ExternalContext.getResource() . But, this is not what happens at all in JSF 2.1. Implicit navigation and all other cases that need to interact with the physical location of the view already go through the ResourceResolver . This is clear from the stacktraces Ed posted on 24/Feb/12 09:13 PM So, in order to satisfy "we only want to search our external repositories when a view id is requested", the existing ResourceResolver already fully did the job and "2. It requires hooking into multiple locations." doesn't apply. Maybe I'm completely missing something though. The new mechanism does seem inline with the comment made by kito on 19/Apr/11
          Hide
          aschwart added a comment -

          Hi Arjan -

          The description makes it sound like ExternalContext.getResource() has to be overridden in addition to providing a ResourceResolver to fully support loading views from another location. Supposedly implicit navigation directly called ExternalContext.getResource().

          But, this is not what happens at all in JSF 2.1.

          Right.

          The issue was originally filed back in 2010, before 2.1 existed.

          In 2.0.x, Mojarra's MultiViewHandler.convertViewId() contains the following logic:

          if (context.getExternalContext().getResource(convertedViewId) != null)

          Unknown macro: { // RELEASE_PENDING (rlubke,driscoll) cache the lookup return convertedViewId; }

          This code is checking for the presence of a view corresponding to a viewId by calling ExternalContext.getResource(). This of course fails for views that are known to the ResourceResolver, but are not accessible via ExternalContext.getResource(). As such, frameworks that plug into the ResourceResolver to enhance the set of views that are available must also plug into ExternalContext.getResource().

          We addressed this in 2.1.x with the addition of ViewDeclarationLanguage.viewExists().

          As of 2.1.x, the above MultiViewHandler code has been replaced with:

          if (vdl.viewExists(context, convertedViewId))

          Unknown macro: { // RELEASE_PENDING (rlubke,driscoll) cache the lookup return convertedViewId; }

          And FaceletViewHandlingStrategy implements this as:

          return faceletFactory.getResourceResolver().resolveUrl(viewId) != null;

          This removes the need for frameworks that provide a ResourceResolver to also plug into ExternalContext.getResource().

          Show
          aschwart added a comment - Hi Arjan - The description makes it sound like ExternalContext.getResource() has to be overridden in addition to providing a ResourceResolver to fully support loading views from another location. Supposedly implicit navigation directly called ExternalContext.getResource(). But, this is not what happens at all in JSF 2.1. Right. The issue was originally filed back in 2010, before 2.1 existed. In 2.0.x, Mojarra's MultiViewHandler.convertViewId() contains the following logic: if (context.getExternalContext().getResource(convertedViewId) != null) Unknown macro: { // RELEASE_PENDING (rlubke,driscoll) cache the lookup return convertedViewId; } This code is checking for the presence of a view corresponding to a viewId by calling ExternalContext.getResource(). This of course fails for views that are known to the ResourceResolver, but are not accessible via ExternalContext.getResource(). As such, frameworks that plug into the ResourceResolver to enhance the set of views that are available must also plug into ExternalContext.getResource(). We addressed this in 2.1.x with the addition of ViewDeclarationLanguage.viewExists(). As of 2.1.x, the above MultiViewHandler code has been replaced with: if (vdl.viewExists(context, convertedViewId)) Unknown macro: { // RELEASE_PENDING (rlubke,driscoll) cache the lookup return convertedViewId; } And FaceletViewHandlingStrategy implements this as: return faceletFactory.getResourceResolver().resolveUrl(viewId) != null; This removes the need for frameworks that provide a ResourceResolver to also plug into ExternalContext.getResource().
          Hide
          aschwart added a comment -

          BTW, Arjan - thank you for http://jdevelopment.nl/jsf-22/ !! :-D

          Show
          aschwart added a comment - BTW, Arjan - thank you for http://jdevelopment.nl/jsf-22/ !! :-D
          Hide
          arjan tijms added a comment -

          The issue was originally filed back in 2010, before 2.1 existed.
          [...]
          This removes the need for frameworks that provide a ResourceResolver to also plug into ExternalContext.getResource().

          Okay, it's clear now Basically this issue was already solved by the addition of ViewDeclarationLanguage.viewExists() in 2.1 and could have been closed then (but it's still great 2.2 went a bit beyond the initial solution). Thanks for the explanation.

          thank you for http://jdevelopment.nl/jsf-22/

          You're welcome! Incidentally, it's for that page mostly that I was wondering about the intent of this issue I also wondered about this since for the OmniFace's extensionless URL support I make heavy use of the ResourceResolver and feared I might have missed something.

          Thanks again for explaining.

          Show
          arjan tijms added a comment - The issue was originally filed back in 2010, before 2.1 existed. [...] This removes the need for frameworks that provide a ResourceResolver to also plug into ExternalContext.getResource(). Okay, it's clear now Basically this issue was already solved by the addition of ViewDeclarationLanguage.viewExists() in 2.1 and could have been closed then (but it's still great 2.2 went a bit beyond the initial solution). Thanks for the explanation. thank you for http://jdevelopment.nl/jsf-22/ You're welcome! Incidentally, it's for that page mostly that I was wondering about the intent of this issue I also wondered about this since for the OmniFace's extensionless URL support I make heavy use of the ResourceResolver and feared I might have missed something. Thanks again for explaining.
          Hide
          Manfred Riem added a comment -

          Closing resolved issue out

          Show
          Manfred Riem added a comment - Closing resolved issue out
          Manfred Riem made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Ed Burns
              Reporter:
              aschwart
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h