title: cq5 include a component inside another component
body: <p>I usually use <code>&lt;cq:include path="fakepath" resourceType="/project/components/testcomponent" /&gt;</code> to include a component inside a another component, named it as "setComponent".</p>
  
  <p>Assume, "setComponent" drag and dropped onto a page and no data entered yet.</p>
  
  <p>Question 1:</p>
  
  <p>First thing is the <strong>"testcomponent" resource does not exist at the /content tree page level and I see GET request to "fakepath.infinity.json" when I double click "testcomponent" to enter data, and this GET request is failing (404 error in browser developer tool console).
  Not sure, whether it is expected behavior.</strong></p>
  
  <p>Question 2:</p>
  
  <p>How can I include component "/apps/project/components/testcomponent"
  inside a parent component using below tags ?</p>
  
  <pre><code>&lt;sling:include path="" /&gt;
  &lt;sling:include resource="" /&gt;
  &lt;sling:include path="" resourceType="" /&gt;
  </code></pre>
  
  <p>I am educating myself to properly understand and trying to see if sling:include could get rid of 404 error that I am talking.</p>
  
  <p>Thank you,
  Sri</p>
  
  <pre><code>&lt;%@include file="/libs/foundation/global.jsp"%&gt;
  &lt;div&gt;
       &lt;cq:include path="navMenu"       
        resourceType="sampleproj/components/common/testMenu" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>pseudocode for testMenu jsp:</p>
  
  <pre><code>  &lt;%@page session="false"%&gt;
    &lt;%@include file="/libs/foundation/global.jsp"%&gt;
    &lt;%@ page import="com.day.cq.commons.Doctype,
      com.day.cq.wcm.api.PageFilter,
      com.day.cq.wcm.foundation.Navigation" %&gt;
    &lt;ul class="nav"&gt;
        &lt;li&gt;&lt;a href='navitempath.html'&gt;&lt;div&gt;navitemtitle&lt;/div&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  </code></pre>