posted 10 months ago I'm not exactly sure I understand, but JSTL is not an executable language. It's a declaration language.
In other words, a "forEach" doesn't execute on the client. It's used to generate static HTML when the server converts the JSP page template to the output HTML stream (web page). So you cannot fire an event on the client, since the page hasn't even been sent to the client yet.
On the other hand, since you're still running in the server, you don't need all that stuff. Just set the info as part of your server session state.
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer