springMVC的forEach不能正常显示

来源:互联网 发布:怎样做网络推广话术 编辑:程序博客网 时间:2024/04/28 15:02

1.问题

在进行springMVC的forEach联系时,出现如下错误

org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/jsp/index.jsp at line 12    <table border="2" bgcolor="aqua" width="500px" >         <c:forEach items="${list}" var="student">         <tr >             <td height="50px">${student.id}</td>            <td height="50px">${student.name}</td>         </tr>        </c:forEach>

2,解决:

forEach的获取是通过getter来进行的,在实体类中添加getter方法即可

原创粉丝点击