On 11/13/09 7:11 AM, webtier_at_javadesktop.org wrote:
> If I use
>
> <h:graphicImage url="/resources/images/foo.gif"/>
>
> it gets rendered as
>
> <img src="/my-context/images/foo.gif" />
>
> But, if I use
>
> <h:graphicImage name="foo.gif" library="images"/>
>
> it gets rendered as
>
> <img src="/my-context/javax.faces.resource/foo.gif.jsf?ln=images" />
>
> You get similar results for h:outputScript and h:outputStylesheet. What is the benefit of this second form? I don't see why it is needed to make resources relocatable. Is it just to make @ResourceDependency work? Or are there other benefits?
>
> Just curious...
>
The URL form:
/my-context/javax.faces.resource/foo.gif.jsf?ln=images
Will cause the FacesServlet to be triggered and then hand off that
request to the ResourceHandler to serve the
resource. When going through the ResourceHandler you have the
following features:
- resource versioning for resources included in the doc root
- resources can be served from the classpath
> - Marty
> http://www.coreservlets.com/JSF-Tutorial/jsf2/
> [Message sent by forum member 'martyhall' ]
>
> http://forums.java.net/jive/thread.jspa?messageID=371727
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>