0

I'm loading achild *.xhtml file in my jsf page with ui:include. When I load this

<html>
  <head/>
  <body>
    Testing
  </body>
</html>

I get this error One or more resources have the target of 'head', but no 'head' component has been defined within the view.

However - when I modify it to this:

<html>
  <!-- <head/> -->
  <body>
    Testing
  </body>
</html>

The error goes away. (The child *.xhtml file comes from a static content team so it can't have jsf directives in it).

What is the root cause? How can this be avoided?

Versions:

  • Mojarra 2.0
  • Java 7.0
  • Tomcat 7.0
  • Windows 7.0
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
hawkeye
  • 34,745
  • 30
  • 150
  • 304

1 Answers1

3

It's talking about the <h:head>. Do the same for the body, which should be <h:body>.

By the way, the generated HTML output must be syntactically valid. You usually don't put <html> in an include file, but only in the parent file or the master template.

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555