Welcome to the new Spring.io forums!
If this is your first visit, be sure to check out the
by clicking the link above, and for security reasons, use the
forgot password link to reset your password..
You may have to register before you can post: click the register
link above to proceed. To start viewing messages, select the forum that you want to visit
from the selection below.
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.