I’m trying to pass a List between two JSP pages that I have. This is a list of objects that is of a class that I wrote.
How do I pass this list between JSP pages? request.setAttribute seems to work for strings, but not anything else. And, if this cannot be easily done with a list, I can convert the list to an array and pass it that way, no problem.
The first thing is that a very bad design will lead to such questions as passing lists between different JSP pages. The “nip the evil at the bud” will be to create a separate java class which contains the list and initializes it, then you can access the list at as many jsp pages as you want.
But incase you really want to do, you can put the list in the session.
Then on the other page you can get
And you should clear the list from the session after you do not require it,