• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

upon click of back button, go to logout page

 
Robert Jack
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i am new one of jsp,

i have developed simple web application...

Step 1 : I have one login page : (contains user-name ,password and submit button)

Step2 : I have one logout page : it has one link (Go to login page), just you
click this link go to login page..

step3 : And i have some pages like (page1,page2,page3, page4.....)

Normal application working following way :

After login comes page1..
Then click some action and it will go to page2
Then i click some action and it will goto page3
Then i click some action and it will goto page4

So now i am in page4...
now i click the back arrow in navigation tool-bar in
browser, generally go to previous page (page3).

For example... If you seeing mail in-box.... that time
you click back arrow..then automatically go to previous
page..


But i need , if i click back arrow in navigation tool-bar
(from any page in my application) ,then
go to logout page...

For example.... Suppose i am in page4... here i click backarrow in
browser then i want to go logout page, don't go to page3

how to achieve this...

Is there any possible....Any JavaScript or AnyOtherway

Please help me about this.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65124
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Jack RobertJohn", please check your private messages for an important administrative matter.
 
Robert Jack
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my JSF application i use this following code ... but not work it...
And i also use session scope

public class LogoutPhaseListener implements PhaseListener
{
public void afterPhase(PhaseEvent event) { }

public void beforePhase(PhaseEvent event)
{
FacesContext facesContext = event.getFacesContext();
HttpServletResponse httpServletResponse = (HttpServletResponse)
facesContext.getExternalContext().getResponse();
httpServletResponse.addHeader("Pragma", "no-cache");
httpServletResponse.addHeader("Cache-Control", "no-cache");
httpServletResponse.addHeader("Cache-Control", "must-revalidate");
httpServletResponse.addHeader("Expires", "Mon, 8 Aug 2006 10:00:00 GMT");
httpServletResponse.addHeader("Cache-Control", "no-store");
}

public PhaseId getPhaseId()
{
return PhaseId.RENDER_RESPONSE;
}
}

If i click back button in browser, then it go to previous page...

but i want to go logout page..when i click back button in browser

http://stackoverflow.com/questions/2627155 :
i have take lot of effort this...but i can't achieve this...can you help me...any sample code or reference?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65124
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"jack RobertJohn", my request that you check your private messages was not a suggestion. Please check your messages now.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic