Refresh the page once every second. response. setheader ("refresh", "1 ");
2 seconds to jump to other pages response. setheader ("refresh", "2; url = otherpagename ");
No cache:
Response. setheader ("Pragma", "No-Cache ");
Response. setheader ("cache-control", "No-Cache ");
Set the expiration time
Response. setdateheader ("expires", system. currenttimemillis () + time period set by yourself );
Access other pages: Response. setstatus (302); response. setheader ("location", "url ");
The compression format used by the notification Browser: Response. setheader ("content-encoding", "compressed data ");
Length of compressed data in High-Speed browsers: Response. setheader ("Content-Length", compressed data. Length + "");
High-speed browser images or videos: Response. setheader ("Content-Type", "this parameter is found in Web. xml under conf in Tomcat ");
Inputstream in = This. getservletcontext. getresourceasstream ("/2.jpg ");
Int Len = 0;
Byte buffer [] = new byte [1, 1024]
Outputstream out = response. getoutputstream ();
While (LEN = in. Read (buffer)> 0 ){
Out. Write (buffer, 0, Len)
}
The high-speed browser has downloaded the form: Response. setheader ("content-disposition", "attachment?filename=2.jpg ");
Inputstream in = This. getservletcontext. getresourceasstream ("/2.jpg ");
Int Len = 0;
Byte buffer [] = new byte [1, 1024]
Outputstream out = response. getoutputstream ();
While (LEN = in. Read (buffer)> 0 ){
Out. Write (buffer, 0, Len)
}
Response. setheader usage