A mistake made about foreach traversal

I encountered such an exception today:


Serious: Servlet.service() for servlet jsp threw exception

javax.servlet.jsp.JspTagException: Don't know how to iterate over supplied "items" in <forEach>

According to the abnormal prompt information, we know that the corresponding collection cannot be traversed. Why? I debugged it and reported an error as soon as I got to the page. The problem was on the page. I looked back and found that it was not a collection but an object. I didn't notice this! After adjustment, it can be used directly (passing a collection for traversal can be used directly).

If an object is taken from another page and directly use EL expression to drop its properties, you can no longer traverse

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325734596&siteId=291194637