This problem has plagued me for a long time. The previous method was to use JS, And now I finally found a solution:
Popular online versions:
<%
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
%>
I tested the actual effective version:
<%
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Cache-Control", "no-store");
response.setDateHeader("Expires", 0);
%>
Note: I add it to JSP files that do not require the browser to cache. The following is an example:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Cache-Control", "no-store");
response.setDateHeader("Expires", 0);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Cache-Control" content="no-store">
<meta http-equiv="Pragma" content="no-cache">
<Title> List page </title>
<Meta http-equiv = "Description" content = "List users for Operation">
<body>
<form name="manage" action="/user_manage/delUser" method="post">
<s:iterator value="list" status="user">
<input type="checkbox" name="user.delId"
value="<s:property value="id" />">
<s:property value="username" />
<s:property value="password" />
<br />
</s:iterator>
<A href = javascript: Manage. Submit ();> Delete the selected user </a>
</form><br />
<A href = "/logout"> log out </a>
<s:debug></s:debug>
</body>