Custom initialization of session scoped bean
I need custom initialization of session scoped beans.
For example, I have defined a session scoped bean currentUser that refers to currently logged in user. I need to create instance of current user based on the parameters present in the request fist time when user logs in.
another example is the example given in spring reference guide about user preferences.
<!-- a HTTP Session-scoped bean exposed as a proxy -->
<bean id="userPreferences" class="com.foo.UserPreferences" scope="session">
<aop:scoped-proxy/>
</bean>
However user preferences needs to be initialized by loading preferences from database. how can I achieve this?
Lot's of folks seems to finding a standard way of achieving this without any success.
Thanks
SN