File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Why is Refresh neccessary when loading the page? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Why is Refresh neccessary when loading the page?" Watch "Why is Refresh neccessary when loading the page?" New topic
Author

Why is Refresh neccessary when loading the page?

Imre Tokai
Ranch Hand

Joined: Jun 04, 2008
Posts: 130
Hello!


I'm creating a server.
When I want to reach new page I get the proper content in the browser, BUT in text format. I'm using OutputStream's methods write, flush, close...
After that, when I click F5 (Refresh), page loads properly.

Any (theoretical) ideas?


Regards
Imre Tokai
Ranch Hand

Joined: Jun 04, 2008
Posts: 130
Posts on other forums:

http://www.java-forums.org/javaserver-pages-jsp-jstl/17785-why-refresh-neccessary-after-loading-page.html
http://forums.java.net/jive/thread.jspa?threadID=59732&tstart=0
http://forums.sun.com/thread.jspa?threadID=5377723&tstart=0


Regards

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61198
    
  66

Are you setting the no-cache headers as described in the FAQ?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Imre Tokai
Ranch Hand

Joined: Jun 04, 2008
Posts: 130
Here is what i have:



Any idea (what's missing)?

I'm looking after explanation on the web for no-cache headers that you mentioned, Bear:
http://faq.javaranch.com/java/NoCacheHeaders


Regards
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61198
    
  66

That's them!
Imre Tokai
Ranch Hand

Joined: Jun 04, 2008
Posts: 130
Let me know if you already know what's wrong and how/where should I make corrections, please?


Regards
Imre Tokai
Ranch Hand

Joined: Jun 04, 2008
Posts: 130
Here is the response header:




Still no luck -TEXT format is loaded on the first attempt...


Regards
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61198
    
  66

"-TEXT format"?
Imre Tokai
Ranch Hand

Joined: Jun 04, 2008
Posts: 130
I don't see the real page, because HTML content is displayed as:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr"><head>............

(problem from the begining)


Regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why is Refresh neccessary when loading the page?