Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF session managment  RSS feed

 
Anasuya Narayana
Greenhorn
Posts: 2
Hibernate Netbeans IDE Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,
i have a requirement to create a project.when the user login to the system based on his role(say role1) he will be shown particular pages(say page1 and page3).I am new to JSF,can i do this with JSF please give me some guidance.
 
Tim Holloway
Bartender
Posts: 18709
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSF has no special characteristics that make it any different than any other J2EE platform for doing that.

I don't personally like login processes that dump me on a designated page no matter what page I originally requested because that deprives me of the ability to bookmark useful functions that are secured. Overall, I'd recommend simply making a "secured home" page and telling people to log in using its URL (can be a link/button on unsecured pages).

Beyond that, there's the whole business of how you manage login. If you write your own login process, then it depends on what "security system" you've devised (I put that in quotes because I've yet to see a user-designed "security system" that was actually secure). If you use the J2EE-standard security system, normal operation would be to send you on to the originally-requested page (bookmark support), but you can put logic in a servletlistener that detects when the HttpServletRequest remote user ID has transitioned from null to not-null and that will cue you to redirect to the post-login page.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!