This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.
No announcement yet.
Non-singleton Controllers on session levelPage Title Module
Is there a way to specify so that the same Controller instance will be used throughout a session and that other sessions will get new Controller instances (if the url mappings point to the same controller of course).
I noticed this post as I'm attempting to code something similar to your suggestion.
I'm attempting to place an instance of an object (MaintenanceService) into the session. At the moment I'm attempting to use an implementation of the HandlerInterceptorAdapter class to create the instance, if one doesn't already exist, and place it in the session.
I noticed that the HandlerInterceptorAdapter class doesn't have access to the application context (via something similar to the getApplicationContext() method). And I would think that using DI via the xml mapping files would create a new instance of MaintenanceService for every instance of the HandlerInterceptorAdapter.