Can "jsp:include" be used in CQ 5?
In a template file, I have a chunk code of like this:
<jsp:include page="/apps/acme/components/menu/menu-items.jsp"> <jsp:param name="menuItem" value="${rootItem}" /> </jsp:include>menu-items.jsp recursively includes itself like:
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <li> ${menuItem.title} <c:if test="${fn:length(menuItem.children) > 0}"> <ul> <c:forEach var="child" items="${menuItem.children}"> <jsp:include page="/apps/acme/components/menu/menu-items.jsp"> <jsp:param name="menuItem" value="${child}"/> </jsp:include> </c:forEach> </ul> </c:if> </li>However CQ encounters an error rendering this:
Caused by: org.apache.sling.api.resource.ResourceNotFoundException: No resource found
I am using jsp:include rather than cq:include because I want to pass a parameter to the script, and as the script is invoked recursively each time with a different value for its parameter I prefer not to use request attributes and manually manage the parameter stack.
However this doesn't seem to work. Is it allowed to use jsp:include in CQ5? Am I missing something here?
Thanks.