I save images, css, and javascript (the folders has the same name) files in a resource folder in the webapp root. Should I be using URLs to get show the image in for example a graphicImage tag or should I be using the #{resources:libraryName..}?
I save images, css, and javascript (the folders has the same name) files in
Share
Just use the therefor provided
<h:outputStylesheet>,<h:outputScript>and<h:graphicImage>components wherein you specify a path relative to the resources folder in thenameattribute:JSF will worry about setting the right URL.
The
#{resource}syntax is only necessary inside CSS files to reference background images.See also: