0

I'm having the same issue like this: A comment has a list of responses and each response has a list of responses and so on...

I would like to display the whole discussion thread:

in jsp, i have this:

<rec:write list="${comment.responses}" />

in the tag file:

<%@ attribute name="list" required="true" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="rec" %>
<%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic"%>



 <c:if test="${!empty list}">
        <ul>
        <c:forEach var="response" items="${list}">
            <li><c:out value="${response.content}"/></li>       
            <rec:write list="${response.responses}"/>   
        </c:forEach>

        </ul>
</c:if>

But i get this exception:

JspException: javax.el.PropertyNotFoundException: Property 'content' not found on type java.lang.String
Community
  • 1
  • 1

2 Answers2

0

I assume it's not as simple as the fact you have mis-spelt response/responses in your jsp code (missing s)?

Rob.

RobP
  • 706
  • 1
  • 8
  • 20
  • No it's not a mis-spelling, that's how its written in French :) – ABDO Zeidane May 19 '14 at 12:35
  • Okay, fair point, let me re-phrase my question - I assume the jsp code object/field names match those of the underlying objects :) - I have just noticed that you have re-written your code. It looks like 'list' is actually a list of Strings, not whatever object type has the content and responses attributes. – RobP May 19 '14 at 13:17
0

I was so close, should have just added the list type:

<%@ attribute name="list" required="true" type="java.util.Set"%>