2017-11-30 20 views
-1

私は以下のリンクで問題を解決しました。リストの値をリストでjstlとして表現する方法は?

enter link description here

結果を以下に示します。

model.addAttribute("commentList", commentList); 

commentList = [{board_comm_writer=Seongwon, board_comm_content=TEST, cocList=[{board_c_of_c_writer=Seongwon, board_c_of_c_content=hi everywon}] 

jstlを使用してcocListの値を表したいとします。その方法のための私の検索の結果

...

<c:forEach items="${commentList}" var="cL"> 
    ${cL.cocList.board_c_of_c_content} 
</c:forEach> 

しかし、これは正しい方法ではないようです。

cocListを表示するにはどうすればよいですか?

+1

答えは問題です。 ForEachループを使用して要素を反復処理します。 –

+0

@JBNizet私の答えをチェック –

答えて

0

私はそれを解決します。

<c:forEach items="${commentList}" var="cL"> 
<c:forEach items="${cL.cocList} var="cLc"> 
    ${cLc.board_c_of_c_content} 
</c:forEach> 
</c:forEach> 
関連する問題