h:outputScript with target=“head” not working with Primefaces 3.5

江枫思渺然 提交于 2019-12-06 11:58:04
BalusC

Since PrimeFaces 3.0, there is a new HeadRenderer which allows customizable resource ordering. See also this blog. This has overriden the standard JSF head renderer. This is at its own okay, but apparently it failed to properly recognize inline scripts with target of head. This is clearly a bug in PrimeFaces head renderer. Your best bet is to report this issue to PF guys.

In the meanwhile, if you aren't making use of that new PrimeFaces feature at all, then just put Mojarra's own HeadRenderer back as default head renderer by adding the following entry to faces-config.xml:

<render-kit>
    <renderer>
        <component-family>javax.faces.Output</component-family>
        <renderer-type>javax.faces.Head</renderer-type>
        <renderer-class>com.sun.faces.renderkit.html_basic.HeadRenderer</renderer-class>
    </renderer>
</render-kit>

Note: in case you're using MyFaces instead of Mojarra, obviously reference MyFaces own one instead.

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