// 禁止缓存
response.setHeader("Cache-Control", "no-store");
response.setHeader("Pragrma", "no-cache");
response.setDateHeader("Expires", 0);
// 链接来源地址
String referer = request.getHeader("referer");
System.out.println("refer is"+referer);
if (referer == null || !referer.contains(request.getServerName())) {
/**
* 如果 链接地址来自其他网站,则返回错误图片
*/
request.getRequestDispatcher("/error.gif").forward(request,
response);
}