• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

upon click of back button, go to logout page

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Jack RobertJohn", please check your private messages for an important administrative matter.
 
Robert Jack
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"jack RobertJohn", my request that you check your private messages was not a suggestion. Please check your messages now.
 
reply
    Bookmark Topic Watch Topic
  • New Topic