I'm trying to make a website for an application we designed, and I'm struggling to find a method to save a session-attribute. I have the following code:
<%
for (int i=0;i< (Integer) session.getAttribute("aantalLijsten");i++){
%>
<a href="wishList.jsp"><%= session.getAttribute("wishList"+i) %></a>
<%
}
%>
where the attributes have been set in a servlet. I want to make a list of links, but they all have to go to the same page. On that page, I will generate the right content, based on the attribute wishList, which is the name on which the user clicked. Can I save that attribute in some way? Something like an "action on click: setAttribute("currentList", getAttribute("wishList"+i))"?