Unable to include global.jsp file | Community
Skip to main content
harshs
Level 3
May 27, 2017
Solved

Unable to include global.jsp file

  • May 27, 2017
  • 2 replies
  • 1462 views

    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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Feike_Visser1

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

This is required for JSP files

2 replies

Feike_Visser1
Adobe Employee
Feike_Visser1Adobe EmployeeAccepted solution
Adobe Employee
May 27, 2017

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

This is required for JSP files

harshs
harshsAuthor
Level 3
May 28, 2017

Thanks Feike