caching XML with JSP

I am writing a web application which grabs XML over HTTP.  The way I am approaching it is that

1-I get the XML over HTTP
2-parse the XML and process it
3-put the processed data  into an ArrayList (approximately 3000 results per request)
4-Then  display the result on JSP like 10 results per page
what happens that  step 1->4 repeat every time I move to next 10 results. Is there any way that my JSP simply pulls stuff from the Array List and dont have to do the parsing  and prcessing over and over ocz it takes v v long this way . If caching is the answer how do i  do it ?
Who is Participating?
bloodredsunConnect With a Mentor Commented:
Just use JSTL's <c:set> tag to store something in the session.

<c:set var="myXmlVar" scope="session">
//Stuff goes here

When you call the arraylist stored in the session, first check if it is empty. If it is empy then retrieve the xml via HTTP. If it is not empty then just use it.
There are multiple ways to handle this.  One way is to cache the list in the application or session object, along with an indication of where you are in the list. Here is where it's described:

Using JSP Variables to Cache Dynamic Content
mostenscerAuthor Commented:
I am not looking fwd to something other than JSTL
mostenscerAuthor Commented:
Correction: i am looking fwd to some thing other than JSTL
Forced accept.

EE Admin
All Courses

From novice to tech pro — start learning today.