• Post Reply Bookmark Topic Watch Topic
  • New Topic

Handling refresh browser using request.getHeader("Accept")

 
sunilkumar pal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am using following code for refresh browser

if(request.getHeader("Accept").equals("*/*")){request.getSession().invalidate();
try{ request.getRequestDispatcher
("/common/sessionExpired.jsp").forward(request,response);
}catch(Exception ex){ }

Its working good.
But problem is that in some system without refresh browser request.getHeader("Accept") return "*/*"
where as it should return "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*" wich is default

please help me for solve above problem .
How to set default header should come like this "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*"

is there any solution for handling refresh browser.

Thanks
Sunil
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what you're trying to do.
What do accept headers have to do with browser refreshing?
 
sunilkumar pal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I am doing if an user refreshing browser then session should expire.

its working properly
But some machine return request.getHeader("Accept") as */* without refreshing browser.

in that case my code was failed..
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am still completely confused as to what you are trying to do.

You expire the session on a refresh? Why would you do that?

And again, what does the accept header have to do with refreshing?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!