Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Session Login Check in JSF !!! Please Help.

843842Apr 1 2005 — edited Nov 9 2008
Hi:

I'm new to JSFs and I have some problem with checking if a user had logged in or not.

As I ask before in this forum, I want to check if a user had logged in in every jsf page and if not the redirect him to the login page.

I got some answer but I didn't understand exactly how to do it. So I'm asking again. Please don't get angry... :-)

We have many jsf pages developed. We also have a jsf login page. But every user should log in before enter the site.

So we must include some king of control in every single jsf page to know if the user exists and is logged in. If don't, then redirect the navigation to the login page.

I tried many ideas and possibles solutions but I can't make it work as described before.

Any kind of help and comments would be appreciated !!!

Thanks a lot.

Felipe

PD: Perhaps, these questions can help to understand my problem.

1) How can I create an instance of a bean (the UserLoginBean with application or session scope) without referencing it from a jsf page. And do it when the user wants to access the site.

2) How can I check in every jsf page if the user had logged in ? I think that I must check first if the UserLoginBean exists and then if the user is logged in, in some Java method of a bean, perhaps the same UserLoginBean.
But how do I call that check from every JSF page ?

3) How I redirect a user to the login page if not logged in ?

4) How I terminate a user session ?

Thanks a lot !!!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 7 2008
Added on Apr 1 2005
22 comments
3,879 views