12

I created a JSF page with PrimeFaces components. The project runs fine, but the PrimeFaces UI look and feel is completely missing. I'm only noticing below message in server log:

One or more resources has the target of 'head' but not 'head' component has been defined within the view

What does this mean and how can I fix the PrimeFaces UI styling?

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
James Forland
  • 155
  • 1
  • 1
  • 6

1 Answers1

32

This means that you're using plain HTML <head> instead of JSF <h:head> in your XHTML template. The JSF <h:head> allows automatic inclusion of CSS/JS resources in the generated HTML <head> via @ResourceDependency annotations. PrimeFaces as being a jQuery based JSF component library needs to auto-include some jQuery/UI JS/CSS files and this really requires a <h:head>.

So, search for a

<head>
    <title>Some title</title>
    ...
</head>

in your templates and replace it by

<h:head>
    <title>Some title</title>
    ...
</h:head>

See also:

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • OK, now the error message disappeared but PrimeFaces and Crud still run separately! – James Forland Sep 23 '13 at 04:36
  • 2
    Just press "Ask Question" button to ask a question about that if you need answers. The current question has already been answered. – BalusC Sep 23 '13 at 10:43