• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Redirect and navigation problem

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Greenhorn
Posts: 12
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,

thanks for your reply! The url is still the same however.
 
Greenhorn
Posts: 1
Netbeans IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!!
 
Ranch Hand
Posts: 33
Android Mac PPC Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey thanks, it really helped me
 
My previous laptop never exploded like that. Read this tiny ad while I sweep up the shards.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic