JSF and background image in CSS folder, without '#{resource}' reference

柔情痞子 提交于 2019-12-12 01:52:50

问题


In a JSF2, i'm trying as this say, to put a background image inside the css folder to avoid the #{resource} reference, being the last option from BalusC:

Much better, however, is to store the CSS-included images in the CSS folder, so that you don't need to fiddle with #{resource} in the CSS.

But when following his instructions, the stylesheet link is built as

<link type="text/css" rel="stylesheet" href="/webapp/javax.faces.resource/css/stylesheet.css.xhtml">

and the content from the CSS, the image, tries to get it from /webapp/javax.faces.resource/css/images folder, where it can't find the image.

What I'm doing wrong?
Because importing the CSS from text.xhtml in the old way:

<link type="text/css" rel="stylesheet" href="resources/css/stylesheet.css" />

It get the image correctly.
Sorry for creating a new question, but I don't have enough reputation to comment :(

来源:https://stackoverflow.com/questions/10280808/jsf-and-background-image-in-css-folder-without-resource-reference

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!