Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to handle browser back button in jsf application

 
rashmi coorg
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using richfaces3 in my web application. the problem I'm facing here is.. if the user has visited some other site like Google.com and visits my application, logs into my application, he is redirected to home page. Now if the user clicks back button he will be redirected to the previous page that is Google.com. And if the user clicks the forward button the user is directly taken to home page, without asking him to login. I am not changing the URL my app even if i am redirecting to other pages in my application. I want to force the user to login in this scenario. how can this be achieved ? please give me your suggestions.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Goes to the homepage because the user still has an active session. There is no way to kill the session when the user goes to another site.

Eric
 
rashmi coorg
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if we can capture the event when browser back button is clicked.. may be we can kill the session on occurrence of that event.. can you suggest me if this can be done.. and if it can be done.. how can we capture the event?
 
Prasad Krishnegowda
Ranch Hand
Posts: 670
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rashmi coorg wrote:if we can capture the event when browser back button is clicked.. may be we can kill the session on occurrence of that event..

Say, user logs in, goes to home page and goes to some other page, in the same application, now if (s)he clicks back, what happens?
 
rashmi coorg
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prasad Krishnegowda wrote:
Say, user logs in, goes to home page and goes to some other page, in the same application, now if (s)he clicks back, what happens?



Within my application the back button is disabled. But when i navigate outside my application. i am facing this problem. The url of the app doesnot change when i navigate from one page to another within the application.
Any suggestions..??
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic