File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Refresh Header Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Refresh Header" Watch "Refresh Header" New topic
Author

Refresh Header

Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1865
hi,
i'm having two problems.
1. i am using response.setHeader("Refresh","5;URL=myurl");
response.sendRedirect("another html page");
this works fine in IE,NN4 but not in NN6! i don't know why. can anybody explain me that?
i got around the above problem using <META HTTP-EQUIV="Refresh" CONTENT="5;URL=myurl"> in my html page where i was redirecting the request after setting header as described in problem 1. it works for IE,NN4,NN6.
but there is a second problem. (well it might not be a problem as all browsers behaves same way).
here it is,
2. say i have put 5 seconds refresh time. and my html page to which i'm redirecting the request from the servlet again goes back to the same servlet. so we will have the same html page refreshed by the browser every 5 seconds. now comes the problem, while this refreshing works, if we press "refresh" button of the browser (when we are viewing the output html) then it stops refreshing it. and in the page source i see that META tag having refresh 5 seconds etc...
why this happens? does my clicking on the "Refresh" button of the browser OVERRIDES my META tag or what?
let me know if i am not clear here.
regards
maulin.


1. Have fun @ http://faq.javaranch.com/java/JavaRaq
2. Looking for simple infix2postfix conversion and postfix evaluation package? Click here
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Refresh Header
 
Similar Threads
meta refresh tag is not working
Session ID changing within session
how to go about it?
servlets and sockets
How to refresh a Servlet automatically ?