I've learned that JSF 2.2 has some special resources mechanism that loads images from the predefined resources/ folder within my web application. That works quite well with an image like this:
<h:graphicImage name="gfx/Logos/Logo.png" alt="Logo" title="Logo" styleClass="logo" />
The resulting src="..."
translates to /context/javax.faces.resource/gfx/Logos/Logo.png.xhtml
as expected.
I'd have thought that the same works with <h:commandButton image="..." />
– but that's not true. The resulting src="..."
attribute is not translated properly.
How can I fix this? Do I really have to use a CSS background image?