One or more resources have the target of head

One or more resources have the target of head

While working with JSF application and when you try to run on application server you see exception:

sourceId=null[severity=(ERROR 2), summary=(One or more resources have the target of ‘head’, but no ‘head’ component has been defined within the view.), detail=(One or more resources have the target of ‘head’, but no ‘head’ component has been defined within the view.)]

Solution: It throws above exception if you using plain HTMLinstead of JSF in your XHTML template. The JSF tag add automatic inclusion of CSS,JS resources on generated HTMLusing @ResourceDependency annotations and PrimeFaces uses jQuery based JSF component library and it auto-include jQuery/UI JS/CSS files which requires a

Replace your:

<head>
    <title>Tile</title>
    ...
</head>

With:

<h:head>
    <title>Title</title>
    ...
</h:head>
One thought on “One or more resources have the target of head”

Leave a Reply

Your email address will not be published. Required fields are marked *