Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Refreshing pages

 
Dale DeMott
Ranch Hand
Posts: 515
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm finding that some of my jsp pages are refreshing when I go back into them. Is there any way I can force a refresh w/out having the user have to adjust their browser to ALWAYS refresh?
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi dear
u can use "refresh" header in your doc. this way your user will not hv to press refresh everytime.
hth
MB
[ October 09, 2002: Message edited by: malhar barai ]
 
Dale DeMott
Ranch Hand
Posts: 515
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How might they go about doing this?
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dale DeMott:
How might they go about doing this?

response.setHeader("Refresh","5");
hth
malhar
 
Dale DeMott
Ranch Hand
Posts: 515
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So in doing so.. first time in the page will refresh immediatly? What will happen the second time in. (after the refresh)
-Dale
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dale DeMott:
So in doing so.. first time in the page will refresh immediatly? What will happen the second time in. (after the refresh)
-Dale

buddy,
you can generate some flag for some business login, & for that particular value of flag u can refresh.
suppose fr the first time u want the page to be refreshed immediately & fr subsequent access u wud like to refresh after more time, then u cud write some logical stmts, set the flag & refresh.
or in refresh header u can specify the time after which the page has to be refreshed, instead of 3 cant u put 300...wouldnt that help...??
MB.
 
Dale DeMott
Ranch Hand
Posts: 515
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm supose I can do that. Would like to find a more elegant way. (if ya know what I mean). I do understand what you're saying.
 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
set the header pragma no cache.
pseudo code:
response.setHeader("PRAGMA","NO-CACHE");
or add <HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"/> to your JSP
this will work with http 1.1 and http 1.0
it tells the browser not to cache your page.
that your page is dynamic and it should get it from the server every time.
note that <HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"/> will not work with IE 5.0 and below...
enjoy
 
Dale DeMott
Ranch Hand
Posts: 515
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good to know (about the browser compatibility) Thanks for the info. This will work great.
-Dale
 
Matt Horton
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not to get off topic... but can people type w/ complete words? I go cross-eyed trying to read some of these posts...
dude, sick! tite brah! I cud code dis won servlet, wuddup!
-or not-
just a suggestion.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic