• Post Reply Bookmark Topic Watch Topic
  • New Topic

Redirect and navigation problem

 
Paolo Pinkel
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey.

I have a webapp, and if the user logs out, some method is called:



The problem is, that the browser address bar still has the file name of the file visited then the user logged out in it.

http://www.example.com/webapp/editSomeStuff.xhtml?lots_of_other_stuff

How can I "clear" that? The problem is, that if the user logs in again, I get an exception because editSomeStuff.xhtml is invoked and several values are not there anymore.

I "fixed" it by doing this:

FacesContext.getCurrentInstance().getExternalContext().redirect("login.xhtml");

But this is not a good solution, is it?

When I tried to avoid that the old URL was called after login by using a navigation-rule:



But for some reason, it didn't make the start.xhtml appear after the user logged in. (The bevavior was just like before.)

Any ideas?

Thank you very much!
 
Emmanuel Borges
Greenhorn
Posts: 12
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried using faces-redirect=true in your links?

Maybe it will solve your problem.
 
Paolo Pinkel
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

thanks for your reply! The url is still the same however.
 
Mike Chirkunov
Greenhorn
Posts: 1
Chrome Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Emmanuel F. Borges wrote:Have you tried using faces-redirect=true in your links?

Maybe it will solve your problem.


Maaan, thanks a lot. It really helped me out!!!
 
Ankit Thakkar
Ranch Hand
Posts: 33
Android Java Mac PPC
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey thanks, it really helped me
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!