jsp - Adding HTML element values to ArrayList Using JSTL? -


problem:

i trying figure out way iterate on series of <li> elements defined on jsp page using jstl. once done value of each li added arraylist in jstl.

is possible?

code

jstl:

jstl code used add html elements arraylist

<%@page import="java.util.arraylist" %> <%      // java inserting names invite arraylist     arraylist<string> list = new arraylist<string>();     list.add(*input search here!*);     request.setattribute("invited", list); %>  

html

example of list elements added arraylist above -

<ul>      <li> 1 </li>      <li> 2 </li>      <li> 3 </li> </ul> 

for example, list.get(0) contain 'one'.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -