Wildfly 10 issue with css file

2019-02-24 07:02发布

<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条回答
太酷不给撩
2楼-- · 2019-02-24 07:18

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

查看更多
登录 后发表回答