0

I have a jsp file with the following

<c:forEach var="node" items="${tree.children}">
  <c:set var="currentNode" value="${node}" scope="request"/>
  <c:out value="${currentNode.displayName}" />
  <jsp:include page="currentNode.jsp"/>
  <br/>
</c:forEach>

with currentNode.jsp containing, at the moment, only

X<c:out value="${currentNode.displayName}" />Y

The variable currentNode should be available in the included jsp file. For example, see this question.

But even this simple example is not working. I am getting the following output

Node 1 XY
Node 2 XY
Node 3 XY

Where I was expecting

Node 1 XNode 1Y
Node 2 XNode 1Y
Node 3 XNode 1Y

What am I missing to make this work?

Community
  • 1
  • 1
Dave Isaacs
  • 4,499
  • 6
  • 31
  • 44

1 Answers1

4

My bet is that you forgot to declare the core taglib in your included JSP. The <c:out> tags will thus be sent as is to the output, and the browser will ignore them. Check the generated HTML code.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255