title: how can I cache an arraylist
body: <p>I'm having one application which fires the same query again and again on every page request coming from the browser. so I want to cache that query result from first time request triggered ,which results in an <strong>arraylist</strong>,  so that on every request coming from browser ,It should not fire the same query again and again.</p>
  
  <p>can you please share your thoughts or inputs ?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p><strong>Frameworks</strong> : I'm using ibatis framework for database query and struts with displaytag for UI</p>
  
  <p><strong>Here is the snippet of code</strong> :</p>
  
  <pre><code>if (req.getParameter("d-2464500-p") == null) {
      UserService userService = UserServiceFactory.getUserService();
      long startTime1 = System.nanoTime();
      log.info("start time is :" + startTime1);
      userList = userService.getUserList();
  } else {
      // I want to use the same queried userList for the other pages
      // so that i should not go and fire the query
  }
  </code></pre>