Hi,
I have the following problem, I have configured the following class which should be stored in session.
<bean id="Users" class="com.doolloop.DlUser" scope="session">
<aop:scoped-proxy/>
</bean>
Then I in my Dispatcher servlet I would like to access this class user and set
@RequestMapping(value="/authenticate.do",method = RequestMethod.POST)
public String sampleAuthentication(@Valid Person person, BindingResult result,
Map model,HttpServletRequest request){
...... /some code
HttpSession session = request.getSession();
DlUser user = (DlUser) session.getAttribute("Users");
/// some uses for user object
}
The problem is that I'm always getting null Value of user object.
What am I doing wrong?
Second problem, I read in articles that accessing HttpSession
is not thread-safe, how can it be done safe way? Should be kind of Singleton? Why this is not Thread Safe operation?
Thank you in advance.
Danny.