[英]I am using struts freamwork, after log out when i pressed browser back button it is going to last opened page. How to send it to log in page?
I am using struts framework, after log out when i pressed browser back button it is going to last opened page. 我正在使用struts框架,注销后,当我按浏览器的后退按钮时,它将转到上一个打开的页面。 How to send it to log in page?
如何发送到登录页面?
Actually i want solution in java not in javascript. 其实我想要Java中没有javascript的解决方案。
I believe you must be having a security filter to intercept all incoming requests. 我相信您必须具有一个安全筛选器来拦截所有传入的请求。 If not you need to have one to authenticate user session.
如果不是,则需要一个来认证用户会话。 Here on failure you can forward to login page.
如果出现故障,您可以转到登录页面。
Also check if the page is rendered from browser cache. 还要检查页面是否从浏览器缓存中呈现。 If so you can set no-cache in the header of the JSP.
如果是这样,您可以在JSP的标头中设置no-cache。
<%
response.setHeader( "Pragma", "no-cache" );
response.setHeader( "Cache-Control", "no-cache" );
response.setDateHeader( "Expires", 0 );
%>
If you have invalidated ( session.invalidate();
) your session through logout, just in action control you forward your request to the jsp page you want. 如果您通过注销使会话无效(
session.invalidate();
),则在操作控制中,您可以将请求转发到所需的jsp页面。 Once session is broken if you press back it won't go to the same page I think. 一旦会话中断,如果您按回去,它将无法进入同一页面。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.