aspose file tools*
The moose likes Beginning Java and the fly likes Keeping current logged user. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Keeping current logged user." Watch "Keeping current logged user." New topic
Author

Keeping current logged user.

Stas Melnychenko
Greenhorn

Joined: Feb 20, 2012
Posts: 14

Hello.
I write my first web application, and I use JSF, Spring, Hibernate.
At first, I wrote authorization/registration part.
I have two pages, mainpage.jsp contain login form, and registration.jsp contain registering form.
And this is my beans:


So, my backbeans UserLogin and UserInfo are request-scoped, because its contain error messages like "Password is incorrect" or "User UserName already exists". And now I need one more session-scoped bean for containing current logged user. But I an not sure, HOW, so tell me please, am I wright:
I want to add new bean UserInfo and change existing bean UserLogin:



and method of UserLogin:



I change to



and UserInfo will contain



Am I on wright way or this is bad shot?

Another method: leave all beans in current stand, and just get current http session in login procedure and save user in it.

So what way is better?

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Keeping current logged user.
 
Similar Threads
session scope
Spring DAO + Hibernate; is this right?
spring+hibernate: insert data into database(one to many)
Error: Bean property 'userDAO' is not writable or has an invalid setter method.
Hibernate error with Spring MVC