Foreach(spring)在JSP中不起作用 [英] Foreach(spring) doesn't work in JSP

查看:79
本文介绍了Foreach(spring)在JSP中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试做一些简单的事情,但是没有用.我想念一些明显的东西吗?

I try to do something easy, but it's not working. Do i miss something obvious ?

我的jsp:

<c:if test="${not empty listeApp}">
<table border = "1">
    <c:forEach var="apps" items="${listeApp}" >
        <tr>
            <td>${apps.ID_APPLICATION}</td>
            <td>${apps.ID_APPLICATION}</td>

        </tr>
    </c:forEach>
</table>

我的控制器:

public ModelAndView portail() {

        applicationDao appDAO = new applicationJPADaoImpl();
        return new ModelAndView("portail", "listeApp", appDAO.listeAll());

}

不显示任何内容.

${listeApp[0].ID_APPLICATION}有效.

我的列表很好,我没有任何问题地将其打印在sysout中. 我可以得到最长的${fn:length(listeApp)},但是我想使用Foreach功能:)

my list is good, i printed it in the sysout without any prob. i can get the lenght ${fn:length(listeApp)} but i would like to use the Foreach feature :)

有什么建议吗? 谢谢

推荐答案

我找到了解决方案: 将此包含在JSP中

I found the solution : include this in JSP

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

我觉得自己是个白痴:)

I feel like an idiot :)

这篇关于Foreach(spring)在JSP中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆