Situation
I have a few single-responsibility Servlets that take a request, do their job, respond, and are done -- no state need be maintained in these cases.
However, I have I "Plain Old Java Object" that maintains state information based on actions the user has initiated on the client that I would like to make available upon request to my Servlets. I would like to make a single instance of this object available and do not need/want to maintain multiple, shared instances.
Side Note: This data is transient (need to keep it for 10 minutes maybe) and not really something I would like to keep in a database.
Question
I have maintained a shared instance of of an object with JSP before, but in this, case a Servlet makes more sense. So, my question is how do I appropriately manage the lifetime of this object that maintains state and can share it among stateless Servlets via HTTP requests, or some other mechanism?
Put another way, if this were an non-web application, the stateless Servlets would be objects I would delegate a task to and the stateful object would maintain the results.
I have looked into ServletContext, but I don't fully understand the purpose of this to know if this is what I need.
Thank you for the help,
-bn