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

下午給項目添加了一個小功能,報這個問題,看下圖:java


嚴重: 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>

搞了半天,最後發現是由於別名起的有問題,spring

var="new",這句出的問題,new是jsp中的關鍵字,mvc

把new定義爲別的OK!jsp

修改後的代碼:spa

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>
相關文章
相關標籤/搜索