当前位置:首页 > JSP教程 > JSP常见问题

按IE后退按钮时让JSP不读缓存


在asp里我曾告诉过朋友如何让asp程序不从缓存里读取数据,同样在jsp里也能实现,请看下面:



1, 使用java提供的方法,在jsp或者servlet中都可以 
<% 
response.setheader("pragma","no-cache"); 
response.setheader("cache-control","no-cache"); 
response.setdateheader("expires", 0); 
%> 
2, 使用html标记,如下面: 
<head> 
<meta http-equiv="pragma" content="no-cache"> 
<meta http-equiv="cache-control" content="no-cache"> 
<meta http-equiv="expires" content="0"> 
</head>



【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐