wood burning stoves 2.0*
The moose likes Struts and the fly likes Need to call struts action on when browser back button is clicked Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Reply locked New topic
Author

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

Mickey Smith
Ranch Hand

Joined: Jun 26, 2006
Posts: 30
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

Joined: Mar 19, 2006
Posts: 66
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
%>


scjp, scwcd
Mickey Smith
Ranch Hand

Joined: Jun 26, 2006
Posts: 30
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 29255
    
140

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I'm. closing this thread. If you want to respond, do so in the other thread.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need to call struts action on when browser back button is clicked
 
Similar Threads
browser back button
How to call Action class when back button is clicked ?
Browser Refresh
Is it possible to make controls on h:dataTable work after a back button has been used.
How to get the url of previous page on click of browser back button