首页 > 代码库 > javax.el.ELException: The identifier [new] is not

javax.el.ELException: The identifier [new] is not

下午给项目添加了一个小功能,报这个问题,看下图:


严重: Servlet.service() for servlet [springmvc] in context with path [/PUP] threw exception [An exception occurred processing JSP page /pages/front/conference/showConferenceDetails.jsp at line 32

29:                    <div class="oh">
30:                        <c:forEach items="${newsList }" var="new" >
31: 	                         <div class="block">
32: 	                       	      <p><img src=http://www.mamicode.com/"/images/news/contentPicture/${new.contentPicture}" width="184" height="114" />

>

搞了半天,最后发现是因为别名起的有问题,

var="new",这句出的问题,new是jsp中的关键字,

把new定义为别的OK!

修改后的代码:

c:forEach items="${newsList }" var="c" >
	                         <div class="block">
	                       	      <p><img src=http://www.mamicode.com/"/images/news/contentPicture/${c.contentPicture}" width="184" height="114" />

>