servlet页面跳转后怎么才能刷新页面

J2EE 码拜 7年前 (2017-04-11) 1447次浏览
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{

request.getSession().removeAttribute(“userid”);
response.sendRedirect(“index.jsp”);
}
页面跳转后发现前台显示的还是原来session还没remove时的数据,必须手工刷新一下才行,有什么办法解决这个问题
解决方案

20

你在页面上进行刷新。
<script type=”text/javascript”>
$(function(){
location.reload();
}
</script>

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明servlet页面跳转后怎么才能刷新页面
喜欢 (0)
[1034331897@qq.com]
分享 (0)