How do I get an arrayList to a jsp page or would it be better to use an array?
ArrayList to JSP page?
Collapse
X
-
Tags: None
-
same as normal usage,
but you have to implement a bean(simply class) that contains an ArrayList, not by extending it, have those setters and getters method if you're comfort to use the convention.... then, use it.......
I have encountered a problem about implementing on it, you may read this thread @ reply #16 to #18, hope it helps -
The simple way to get an object into a JSP page is to use any of the available scopes (page, request, session, application). The most often used scopes are request and session.
You can use it via the following code snippets.
How can you set an attribute in the scopes? using the same scope but with the setAttribute() method as follows.Code:request.getAttribute("<NameWithWhichYouBoundTheArrayList>");
I believe you are aware of how to deal with (creation and population of) arraylists in the page where you set the attribute in a particular scope!Code:request.setAttribute("<NameToBindTheArrayList>",arrayListObj);Comment
Comment