NumberFormatException when accessing collection in JSP EL

坚强是说给别人听的谎言 提交于 2019-12-06 05:21:47

In ${e.roles.roleName} e.roles is a Collection. This means that roleName is interpreted as an integer. see http://docs.oracle.com/cd/E19226-01/820-7627/gjddd/

If you are accessing an item in an array or list, you must use either a literal value that can be converted to int or the [] notation with an int and without quotes. The following examples could all resolve to the same item in a list or array, assuming that socks can be converted to int:

${customer.orders[1]}

${customer.orders.socks}

You should probably iterate over the collection, and then access its roleName

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!