Display a list in a list with a foreach in jsp

后端 未结 3 1056
一整个雨季
一整个雨季 2021-01-26 00:27

Is it possible to display the elements of a list in a list with a foreach in a jsp?

List> elements;

i was thinking som

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-26 01:15

    Your syntax will work in EL 2.2 (which is available since Servlet 3.0 containers such as Tomcat 7, Glassfish 3, etc), but not in older versions. You can then use the brace notation [] to get the desired list item by index.

    
        ...
    
    

    You can if necessary use a nested to display all items.

    
        
            ...
        
    
    

    See also:

    • Our EL wiki page

提交回复
热议问题