parent.jsp

<c:forEach var="instanceVar" items="${instanceList}">
    <jsp:include page="child.jsp">
        <jsp:param name="myVar" value="${instanceVar}"/>
    </jsp:include>
</c:forEach>

child.jsp

<c:out value="${param.myVar}"/>

Another alternative is using JSTL tag c:set and request scope.

<c:set var="instance" value="${your.value}" scope="request"/>
<jsp:include page="instance.jsp"/>

instance.jsp
You should take out the variable from request Scope

<c:out value="${instance}"/>
Posted in JSP.

Comments are closed.