My stylesheet.css is located in the file META-INF / resources / css / stylesheet.css
META-INF? So, this is due to the JAR file, which in turn fell into webapp /WEB-INF/lib ?
Regardless, you should use the #{resource} resolver instead of resolving the classpath resources for the correct /javax.faces.resource URLs.
src: url("#{resource['css:websymbols-regular-webfont.eot']}"); src: url("#{resource['css:websymbols-regular-webfont.eot']}?#iefix") format('embedded-opentype'), url("#{resource['css:websymbols-regular-webfont.woff']}") format('woff'), url("#{resource['css:websymbols-regular-webfont.ttf']}") format('truetype'), url("#{resource['css:websymbols-regular-webfont.svg']}#WebSymbolsRegular") format('svg');
In addition, I recommend placing one additional path in the /resources folder, which can then represent the name of the real library. library="css" is the misuse of the resource library. It should not represent specific resource types (CSS / JS / images) at all, but is the real common name of the library. For example, /common . You can then reference the stylesheet and resources as follows:
<h:outputStylesheet library="common" name="css/stylesheet.css" />
and
src: url("#{resource['common:css/websymbols-regular-webfont.eot']}"); src: url("#{resource['common:css/websymbols-regular-webfont.eot']}?#iefix") format('embedded-opentype'), url("#{resource['common:css/websymbols-regular-webfont.woff']}") format('woff'), url("#{resource['common:css/websymbols-regular-webfont.ttf']}") format('truetype'), url("#{resource['common:css/websymbols-regular-webfont.svg']}#WebSymbolsRegular") format('svg');
See also:
Balusc
source share