How do get the user currently logged on from the session object in Hibernate. I'm using Spring and Acegi security filters.
Is this an Spring/Acegi issue?
Normally I would do like this:
Code:
HttpSession session = request.getSession();
String userName = (String) session.getAttribute("USER_NAME");
The HttpSession object is it almost the same as hibernate session object? Can I use it to get the current user?
Code:
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();