<h:outputstylesheet>不会向HTML呈现任何内容</h:outputstylesheet>

时间:2014-02-07 12:27:58

标签: html css jsf-2

我正在使用JSF2和primefaces,并且无法加载css表。

CSS存储在@WebContent / resources / css / style.css

XHTML:

<h:head></h:head>
<h:body>
<h:outputStylesheet name="css/styles.css" />

我尝试在h:head中找到h:outputStylesheet,并尝试使用library =“css”标签无效。

输出html如下:

<head>
<link type="text/css" rel="stylesheet" href="/WireTapLogSearchUtility/faces/javax.faces.resource/theme.css?ln=primefaces-home" />
<link rel="stylesheet" media="screen" type="text/css" href="/WireTapLogSearchUtility/faces/javax.faces.resource/primefaces.css?ln=primefaces&amp;v=3.2" />
<script type="text/javascript" src="/WireTapLogSearchUtility/faces/javax.faces.resource/jquery/jquery.js?ln=primefaces&amp;v=3.2"><!--//-->
</script><script type="text/javascript" src="/WireTapLogSearchUtility/faces/javax.faces.resource/primefaces.js?ln=primefaces&amp;v=3.2"><!--//-->
</script><script type="text/javascript" src="/WireTapLogSearchUtility/faces/javax.faces.resource/jsf.js?ln=javax.faces"><!--//--></script>
</head>

在源上使用ctrl + f没有style.css

的结果

此外,我确实在web.xml中有映射:

<servlet-mapping>
  <servlet-name>Faces Servlet</servlet-name>
  <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>

0 个答案:

没有答案