• Post Reply Bookmark Topic Watch Topic
  • New Topic

Session Management in JSF  RSS feed

 
Amir Iqbal
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it possible to manage session in jsf??
means when a user logs in he can access all the pages and when he log out. he cant access some specific pages. ???

Please help me out.
All kinds of suggestions and solutions are warmly welcome
regards.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Amir Iqbal:
is it possible to manage session in jsf??

Of course. JSF just runs on top of JSP/Servlets.
means when a user logs in he can access all the pages and when he log out. he cant access some specific pages. ???

You normally use a Filter for that.

Pseudo:

and map it on an url-pattern covering the protected pages.
 
Amir Iqbal
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Alot Bauke. for your Help
would you please tell how can i store username in Session. and how can i remove it when user logs off .
if Possible then please do put code snipet .
Regards
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Amir Iqbal:
Thanks Alot Bauke. for your Help
would you please tell how can i store username in Session. and how can i remove it when user logs off .

In JSF: use ExternalContext#getSessionMap().
In JSP/Servlet: use HttpSession#get/setAttribute().

if Possible then please do put code snipet .

You should not ask for code.
 
Y Jadhav
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Bauke Scholtz .
One more time you help me.

remember me?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!