Is it possible to access dynamically generated session scoped attributes in JSP? For instance, assume I have session variables like C1, C2, .. Cn generated in a servlet and I know the value of n too. Is it now possible to access them in JSP?
Using JSTL you could use the implicit variable 'sessionScope' to get a map of session attributes.
However I think the design may be better if you put one list/map into session scope, rather than n session attributes, one for each entry.
You could then use the standard jstl forEach loop on the list/map and it implicitly knows its own size.
posted 8 years ago
Thanks for your reply Stefan. I will go with the design proposed by you. I hope that will work.
If you are using a wood chipper, you are doing it wrong. Even on this tiny ad: