You can use JSP's built in facility, session and application objects for caching. session object is available for a user session across multiple requests and application object is available for all users using the application. You can cache data into these objects and get this cached data whenever you require. The methods that support caching are.
session.setAttribute(String name, Object cacheableObject);
session.getAttribute(String name);
application.setAttribute(String name, Object cacheableObject);
application.getAttribute(String name);