If someone encounters this or similar strange problems with facelets like
One or more resources have the target of "head", but no "head" component has been defined within the view.
just change the javax.faces.jar to a current version. To do this:
First: find the "modules" folder from the glassfish installation. On my Mac it's
/Applications/NetBeans/glassfish-4.0/glassfish/modules/
Second: find the javax.faces.jar and replace it with a current version (just search the net and download). In my case it is javax.faces-2-2-5.jar found at https://maven.java.net/content/repositories/releases/org/glassfish/javax.faces/2.2.5/
Third: don't forget to restart NetBeans