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

Avatar

Level 3

Thanks Feike

The following has evaluated to null or missing: ==> liql("SELECT id, subject, body, depth, post_time, author.login, author.id, author.rank, metrics.views FROM messages WHERE topic.id = '${topicId}' AND is_solution = true").data.items[0] [in template "analytics-container" at line 82, column 31] ---- Tip: It's the final [] step that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign acceptedAnswer = liql("SELECT... [in template "analytics-container" at line 82, column 5] ----