• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Keeping current logged user.

 
Stas Melnychenko
Greenhorn
Posts: 14
Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic