I’m relatively new at creating web applications so bear with me.
I have a legacy application which I would like to host on tomcat. This application takes long to start-up (10 seconds?) and consumes a lot of resources. I would like to have only one instance of this application running at any given time.
I would like to setup tomcat so that there can be either 0 or 1 sessions at any given time. When a user connects for the first time, a session is created which fires up an instance of the legacy app, any any subsequent users would use the same session.
It seems like the default behavior for tomcat is to create a new session for each user which will not work for me.
Can you please advise on how I can setup tomcat so that the session created by the first user is used by the subsequent users?
I ended up implementing a HttpSessionListener which maintained the single instance: