This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
See welcome thread
Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Keeping current logged user.  RSS feed

Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Boost this thread!