• 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

disable the back button in webapplication

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
disable the back button in webapplication


after logout the user is sent back to the login page and there if he press the back button the request should go to the controller(server) and
check whether is he properly logged in if yes allow him other wise display the login page...


help guys give me some nice code or some good suggestions for this...
 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Generally browsers store pages in their cache and when you press the back button, the browser displays the page from its cache. To make the browser request the page again from the server (so that you can check whether the user is logged in or not), you'll have to put some headers in the pages which you only want to be visible after user is logged in. Read this to know which headers to use...
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sandy indiranagar wrote:


Like I had requested you before here you really need to check your private messages and take appropriate action. Please note this is not optional.

It is expected you take the required action, before you post again.
 
sandy indira
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
friend i dont want to disable the back button instead i want to create a check on user..

after logout if he press the back button the request should go to the controller and check is he a valid user if yes
allow him or if not redirect him to the login page...


and i saw the private message there were no new messhages...plss i have seen the naming convention..even if needed i can again change just tell me if needed...
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check again
 
sandy indira
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
friends i tried all these but it didnt help..

it still caching the data...i.e the name if the user and allowing him to come back to the home page after logout by pressing back button...

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="Sat, 01 Dec 2001 00:00:00 GMT">
<meta http-equiv="expires" content=<%= new java.util.Date() %>>
<meta http-equiv="no-cache">
<script type="text/javascript"></script>
</head>
<body>

<% response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", 0);
response.setHeader("Cache-Control","no-store"); //HTTP 1.1 %>



<--body of my page----->

</body>
<HEAD>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
</HEAD>
</html>
 
Ankit Garg
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sandy please restrict talk about one problem to one thread, don't post the same problem multiple times like here or here...
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sandy , which framework are you using . Spring implicitly handles this because each request madatorily hits the controller before the JSP is invoked. If you are using Struts you might have to write an Ajax call on the "onPageLoad" of the previous page which the control would go on hitting back and then send the request to a different class where you can perform some logic.

Hope this helps.
 
reply
    Bookmark Topic Watch Topic
  • New Topic