This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JSF and the fly likes Going to previous state in JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Going to previous state in JSF" Watch "Going to previous state in JSF" New topic

Going to previous state in JSF

Syed Muhammad Ali Naqvi

Joined: Feb 07, 2008
Posts: 2
Hello to All
I am facing a little problem. When I am not logged in to my system and when I ask browser to redirect me to some page in my application it takes me to login screen and loads default screen.

Suppose I want to redirect my self to Admin Panel page. My application redirects me to Login page for Login. But afer successfull login I am redirected to say "Welcome" page. Please tell me that how I can avoid it. If I pass the address of my Admin Panel page then I want my application to take me to a page of Admin Panel after successful login rather than taking to default page.

I hope you get my question

Syed Muhammad Ali Naqvi
Abzee AntiPro

Joined: Aug 23, 2010
Posts: 14

Is your application using any phaseListener?

check your faces.config file!!

Many a times, the phase listener checks if the user requesting the page (say admin page) is a valid user who has logged in through the login page?
if the user is not logged in and user data is not in the session. the phase listeners redirects you to login page and asks you to login first.

once you login you can hit the admin page and you wont be redirected.

i hope i got your question right.

Back to the Basics. Thats the only solution.
I agree. Here's the link:
subject: Going to previous state in JSF
It's not a secret anymore!