任何人都可以帮助我理解我的jsp页面有什么问题。 'foreach'循环正在运行,但项目的成员不显示(简单文本出现在他们的位置)
<c:forEach items="${model}" var="item">
<tr>
<td height="10"><hr width="100%" size="2" /></td>
</tr>
<tr>
...
<td width = 10%>
</td>
</tr>
<tr>
<td height="20"><p>Author: $(item.author)</p>
<p>Last updated: $(item.timeLastUpdated)</p>
<p># comments: $(item.commentsCount)</p>
</td>
</tr>
<tr>
<td height="45"><p>$(item.text)</p></td>
</tr>
<tr>
<td height="45"><p><%=item.text%></p></td>
</tr>
</c:forEach>
页面的控制器如下:
@RequestMapping(value = "/", method = RequestMethod.GET)
public ModelAndView home(Locale locale, Model model)
{
logger.info("Welcome home! the client locale is "+ locale.toString());
logger.info("Running SIMPLE_BLOG");
Date date = new Date();
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
String formattedDate = dateFormat.format(date);
model.addAttribute("serverTime", formattedDate );
Iterable<Topic> listTopic = service.findAllTopics();
return new ModelAndView("home", "model", listTopic);
}