Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
944 views
in Technique[技术] by (71.8m points)

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

I'm using NetBeans 7.3.1 and PrimeFaces 3.5 on GlassFish 3.2.

I created a JSF page with PrimeFaces components. The project runs fine, but the PrimeFaces UI look'n'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 look'n'feel?

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...