I guess you can find some clue in the .content.xml in your components/page/contentpage directory, the "sling:resourceSuperType" should be "yourprojectname/component/page" which means your contentpage is implemented from "yourprojectname/component/page".
Then check the .content.xml file in "yourprojectname/component/page" directory, the "sling:resourceSuperType" should be "foundation/components/page".
Now you can check "libs/foundation/components/page/page.jsp" there's a <cq:include script="body.jsp"/>. To my understand, sling is resolving "page.jsp" as the script, and page.jsp includes the body.jsp.
Or forget about the .content.xml, you can also use CRXDE lite to check the sling:resourceSuperType, it is a property of your "contentpage" node.
Hi Black Nike,
Yes this looks good and I think I understand it now!. By extending the page component (sling:resourceSuperType) the page.jsp is selected from “foundation/component/page” which contains “cq:includes of head.jsp and body.jsp”. Therfore I see CQ looks in apps and then libs for those scripts - effectively letting us extends them. Please correct me if I am wrong.
Thank you very much for taking the time to respond!