Wildfly 10 issue with css file

三世轮回 提交于 2020-01-11 09:16:32

问题


<h:outputStylesheet library="test/css"  name="style.css" />

Above code is not working in wildfly 10 with jar file jsf-impl-2.2.12-jbossorg-2.

Issue getting is:

WARNING [javax.enterprise.resource.webcontainer.jsf.application] (default task-6) JSF1064: Unable to find or serve resource, style.css, from library, test/css.

Can anyone help on this ?


回答1:


The value of a library attribute should not be a path but a reference to a single folder (grouping css ,js etc.) and a direct descendant of the resources folder.

So changing

<h:outputStylesheet library="test/css"  name="style.css" />

to

<h:outputStylesheet library="test"  name="css/style.css" />

should make it work.

Mojarra has been too liberal in this and it seems they are 'improving' things. I ran into a similar difference with the location of composite components. MyFaces did not allow paths in there as well, while Mojarra (until at least 2.2.12) still does.

For more details on best usage, see

  • What is the JSF resource library for and how should it be used?


来源:https://stackoverflow.com/questions/35719808/wildfly-10-issue-with-css-file

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