简体   繁体   English

JSF和CSS无效

[英]JSF and css don't work

I am using JSF 2.2 in a regular dynamic web project , i have included a css code in a xhtml page. 我在常规动态Web项目中使用JSF 2.2,我在xhtml页面中包含了CSS代码。

Web-content WEB-CONTENT Ressources css style.ss Web内容WEB-CONTENT资源css style.ss

in my index.xhtml i used this code 在我的index.xhtml中,我使用了此代码

       <link rel="stylesheet" href="WEB-INF/Ressources/css/style.css" type="text/css"/>

but the css doesn't work 但CSS不起作用

Files inside WEB-INF aren't accessible from the outside. 无法从外部访问WEB-INF中的文件。 You have to place them in some other directory. 您必须将它们放置在其他目录中。 For example: 例如:

<link rel="stylesheet" 
      href="#{request.contextPath}/Ressources/css/style.css" type="text/css"/>

我有同样的问题..如果您使用的是maven或不确定css文件在哪里,只需使用winzip打开war文件,然后查看css路径是什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM