Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
    Bookmark Topic Watch Topic
  • New Topic

Need to call struts action on when browser back button is clicked

 
Mickey Smith
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,

I need to give a call to my action class in case the browser back button is clicked.

Can i have the solution for the same ?

Thanks in advance
Mickey
 
prasad kulkarni
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Report post to moderator
for this, do not let the browser to catch your jsp files. Put following lines in your jsp files , so that the files will not get cached by browser.

<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
 
Mickey Smith
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi Prasad,

I have removed the caching part.

Can you please send the piece of code by which i can give a call to my action class. I think it will be a javascript call.

Thanks & Regards,
Mickey Smith
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34375
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Mickey,
As Eric noted in your other thread, it is not possible to intercept the back button.

In the future, please do not post the same question in multiple forums. This makes it difficult to follow the conversation.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Report post to moderator
I'm. closing this thread. If you want to respond, do so in the other thread.
 
    Bookmark Topic Watch Topic
  • New Topic