Iterate ArrayList in JSP

后端 未结 5 1666
遥遥无期
遥遥无期 2020-12-03 15:54

I have two arraylists in my class and I want to send it to my JSP and then iterate the elements in arraylist in a select tag.

Here is my class:

packa         


        
5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-03 16:08

    You can use JSTL's foreach.

    
       ${item}
    
    

    You need also to import JSTL core:

    <%@ taglib prefix="c" 
           uri="http://java.sun.com/jsp/jstl/core" %>
    

提交回复
热议问题