Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

jsp:include is failing

Avatar

Level 2

Hi ,

i am seeing the following error while while including jsp in another jsp (jsp:include).

http://localhost:4502/content/ac/ca/en/email.demo.html

in demo.jsp i have included demo1.jsp

inspect element in browser
<!--cq{"decorated":false,"type":"sling:redirect","path":"/","selectors":"demo","servlet":"RedirectServlet","totalTime":0,"selfTime":0}-->

error log

25.08.2017 12:57:14.781 *WARN* [127.0.0.1 [1503646034778] GET /content/aircanada/ca/en/email.demo.html HTTP/1.1] org.apache.sling.servlets.get.impl.RedirectServlet RedirectServlet: Servlet is included, not redirecting

Thanks

Srinu

3 Replies

Avatar

Administrator

If it is an include before compile time you can use the same as is used for the global.jsp:<%@include file="/libs/foundation/global.jsp"%>

If you are including AEM components or just another JSP with its own context, you either use cq:include or sling:include, the latter allows additional parameters and lets you override some request scope variables:

<cq:include path="par" resourceType="foundation/components/parsys" />

or

<cq:include script="body.jsp" />

A documentation regarding the tag libraries in AEM can be found here: Tag Libraries

~kautuk



Kautuk Sahni

Avatar

Level 2

with cq:include sightly expression language is conflicting with freemarker expression which starts with '${}'

Avatar

Level 2

with cq:include sightly expression language is conflicting with freemarker expression which starts with '${}'