中显示值环形

发布于 2024-12-06 23:43:31 字数 528 浏览 1 评论 0原文

我正在使用 Spring MVC 3。从我的控制器中,我

mav = new ModelAndView();
mav.setViewName("reports");
mav.addObject("ReportList", ReportList);
return mav;

在 JSP

<c:forEach var="list" items="${ReportList}">
   $(list.name)
</c:forEach>

ReportList 中设置值,其大小为 7。ReportListReport 类的列表以 name 作为实例,并具有适当的 getter 和 setter。

当我在浏览器中运行它时,它显示 $(list.name) 7 次。

它不显示正确的名称。

I am using Spring MVC 3. From my controller I set value

mav = new ModelAndView();
mav.setViewName("reports");
mav.addObject("ReportList", ReportList);
return mav;

In JSP

<c:forEach var="list" items="${ReportList}">
   $(list.name)
</c:forEach>

ReportList has a size of 7. ReportList is a list of Report class having name as instance with proper getters and setters.

When I run it in browser it displays $(list.name) 7 times.

Its not displaying proper names.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

冷清清 2024-12-13 23:43:31

这些括号:{ }

<c:forEach var="list" items="${ReportList}">
   ${list.name}
</c:forEach>

These brackets: { }

<c:forEach var="list" items="${ReportList}">
   ${list.name}
</c:forEach>
毁梦 2024-12-13 23:43:31

它应该是 ${list.name} ...

It should be ${list.name} ...

萌化 2024-12-13 23:43:31

您应该使用 标记来呈现 name 属性的值。 #{list.name} 也可能有效(将 ( 替换为 {)。

You should use the <c:out> tag to render the value of the name attribute. #{list.name} might work as well (replace ( with {).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文