让html以及jsp页面不被缓存
对于HTM网页,加入:
<meta HTTP-EQUIV="pragma" CONTENT="no-cache">
<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<meta HTTP-EQUIV="expires" CONTENT="0">
然后,jsp页面中加入:
<%
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragrma","no-cache");
response.setDateHeader("Expires",0);
%>
相关文档:
<%@ page contentType="text/html;charset=GBK"%>
<%@page import="java.util.*"%>
<%@page import="java.io.*" %>
<%
//在这里如果写成“WEB-INF\templates\template.htm”程序会报错
String filePath = request.getRealPath("/")+"WEB-INF/templates/template.htm"; &nbs ......
META标签是放于网页源文件中HEAD 与 /HEAD之间的标记,其主要功能为:
XML/HTML Code 复制内容到剪贴板 meta name = Description content = 网页的描述 该网页的描述,作用于搜索引擎的登
<META>标签是放于网页源文件中<HEAD> 与 </HEAD>之间的标记,其主要功能为:
<
meta
name
=
&q ......
try {
URL url = new URL("http://www.163.com");
InputStream is = url.openStream();
byte[] buffer = new byte[1024];
  ......