dcsimg
redirect to a URL when a user enters Refresh button
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   santosh_kunala
Posted On:   Thursday, October 4, 2001 07:10 PM

			
Using servlet programming can we redirect to a URL when a

user clicks on the refresh button of his browser?

Re: redirect to a URL when a user enters Refresh button

Posted By:   Andrew_Watson  
Posted On:   Thursday, October 11, 2001 10:07 AM

When the initial servlet request is made, create a session (you may put some identification parameters into the session).
The created session will send a cookie to the client.
If the client (browser) is refreshed, check if the servlet parameters have changed, if not, you know it's a refresh.

Redirect the client via res.sendRedirect(targetURL).


Alternatives: place a small applet into the browser and intercept the refresh and Ctrl+refresh events.
Once intercepted, you can notify the servlet to redirect or execute JavaScript for the redirection.
About | Sitemap | Contact