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="/images/news/contentPicture/${new.contentPicture}" width="184" height="114" /></p>
33: 	                              <p>${c.title }</p>
34: 	                        </div>
35:                         </c:forEach>

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

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

把new定义为别的OK!

修改后的代码:

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



javax.el.ELException: The identifier [new] is not,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。