Expand my Community achievements bar.

SOLVED

Unable to include global.jsp file

Avatar

Level 3

    Hello!

I am using a simple Hello World program and including the global.jsp in the body.html file.  I am using sightly or HTL for this.  Below are the files

contentpage.html

<html>
<head>
<title>Hello World!!!</title>    
</head>
<div data-sly-include="body.html"/>
</html>

body.html

<%@include file="/libs/foundation/global.jsp"%>
<body>
        <h1>Welcome to HTL</h1>
        <h2> I am using Sightly    </h2>
        <h3>Properties</h3>

        <p>Title: ${currentPage.properties.jcr.title}</p>
        
        <h3>Page Details</h3>
        <p>Title: ${currentPage.Title}</p>
        <p>Name: ${currentPage.Name}</p>
        <p>Path: ${currentPage.Path}</p>
        <p>Depth: ${currentPage.Depth}</p>
        
        <h3>Node Details</h3>
        <p>Name: ${currentNode.Name}</p>
        <p>Path: ${currentNode.Path}</p>
        <p>Depth; ${currentNode.Depth}</p>
    
    </body>

Problem statement: The global.jsp file is not included, rather the directive "<%@include file="/libs/foundation/global.jsp"%>" is printed as is on the page.  See the attached for details.  Why is the global.jsp file not included ?

Regards

Harshs

1 Accepted Solution

Avatar

Correct answer by
Employee

There is no need to include global.jsp in HTL files.

This is required for JSP files

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

There is no need to include global.jsp in HTL files.

This is required for JSP files