Hi good people,
I'm coding a simple blogging portal using Spring MVC and Spring Security + Hibernate. Im stuck on problem I don't know how to solve. The problem is in create blog functionality. User inputs title of new blog and description. Now to succesfully store the new blog in DB (I want to do this from within controller) i need UserId property of Blog object to be filled in with current user in session id. But I've got no idea how to get to the id from within controller. From
jsp i can use request.GetUserPrincipal().getName() and execute it agains dao, but I don't think that using dao from jsp level is a good idea. I've got this feeling that I can't see the solution which probably is simple. Help!