簡體   English   中英

<JSP>陷入錯誤:“未終止&lt;c:forEach標記”

[英]<JSP>Stuck in the error : “Unterminated &lt;c:forEach tag ”

我正在研究JSP並且遇到了這個錯誤“Unterminated <c:forEach tag”

這是來自contentStatis.jsp的相關部分

<tbody>

            <br><c:forEach var="contentStatis" items="${resultcount}" >
                <td align="center"><c:out value="${contentStatis.dtm}" /></td>
                <td align="center"><c:out value="${contentStatis.StudentPkg}" /></td>
                <td align="center"><c:out value="${contentStatis.Shared}" /></td>
                <td align="center"><c:out value="${contentStatis.NonShared}" /></td>                

            </tbody>

這是Controller.java的相關部分

List<ContentStatis> result = ContentStatisRepository.statis(maps);
List<ContentStatis> resultcount = ContentStatisRepository.mnote(maps);
Pagination<ContentStatis> resultList = PaginationUtil.getPaginationList(result, condition, (long)result.size(), Order.DESC);

model.addAttribute("result", result);
model.addAttribute("condition", condition);
model.addAttribute("resultList", resultList);
model.addAttribute("resultcount", resultcount);         
    }
    return "admin/statisMng/contentStatis";

這是Repository.java的相關部分

    @Statement(id="ContentStatis.mnote")
public List<ContentStatis> mnote(Map<String, Object> maps);

有誰看到問題所在? 當我執行jsp時,會發生錯誤

“/WEB-INF/views/admin/statisMng/contentStatis.jsp(459,0)未終止<c:forEach tag”

大多數jstl標簽都是塊標簽,因此需要終止它們

通過使用<tag/><tag></tag>

<c:forEach var="contentStatis" items="${resultcount}" >
    <td align="center"><c:out value="${contentStatis.dtm}" /></td>
    <td align="center"><c:out value="${contentStatis.StudentPkg}" /></td>
    <td align="center"><c:out value="${contentStatis.Shared}" /></td>
    <td align="center"><c:out value="${contentStatis.NonShared}" /></td>   
</c:forEach>  <!-- you are missing this bit -->

你需要</c:forEach>包裝內容

我很確定你的錯誤告訴你究竟是什么問題。 此標記未終止

<c:forEach var="contentStatis" items="${resultcount}" >

在某個地方你需要添加一個

</c:forEach>

你忘了結束了

<c:forEach>

標記,關閉它:

</c:forEach>

這是自我解釋:

"/WEB-INF/views/admin/statisMng/contentStatis.jsp(459,0) Unterminated <c:forEach tag"

意味着你需要關閉標簽。 或“終止”它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM