Search code examples
aemsling

How to include a content page in jsp in aem?


How can I include one of my AEM page from content in my component's JSP?

I have a page created at /content/www-mysite-com/en/page1 which has parsys and components dragged and dropped in it and now I want to include this content in a a components so that my component's author-ability is better.


Solution

  • use sling include tag from sling tag librabry

    <div id="someDiv">
        <c:set var="mypage" value="/content/www-mysite-com/en/page1" />
        <sling:include path="${mypage}.content.html" />
    </div>