Hi Agelos

Regarding your 2nd point:

2)      2) The minor issue I have regards (the otherwise brilliant) @Query,
> due to its constraint of annotating (mainly) Iterable and NOT allowing Set,
> List etc (a runtime exception is thrown
> org.springframework.data.neo4j.conversion.QueryResultBuilder$1 cannot be
> cast to java.util.List).
>
> This wouldn’t be a huge problem, but the JSP/JSLT <forEach> tag DOESNOT
> iterate Iterable (!!!), nor you can directly call .iterator() from within
> JSP, making life hard on both ends.
>

>From the controller, just pass the iterator of the iterable to your JSP.
With Spring MVC, this would look like:

    @RequestMapping(method = RequestMethod.GET)
    public String list(Model uiModel) {
        uiModel.addAttribute("kpis", kpiRepository.findAll().iterator());
        return "secure/kpis/list";
    }

In your JSP, you then can use this iterator as expected:

<c:forEach items="${kpis}" var="kpi">
<tr>
<td><c:out value="${kpi.uuid}" /></td>
<td><c:out value="${kpi.name}" /></td>
</tr>
</c:forEach>


Best regards,
James
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to