简体   繁体   English

登录后禁用JSP中的后退按钮吗?

[英]Disabling back button in JSP after logging in?

(Disabling back button in JSP after logging in?) (登录后要禁用JSP中的后退按钮吗?)

What does this code mean? 此代码是什么意思? Anyone pls explain this following code.Because, I never studied about this 'response.setHeader' method. 任何人都请解释下面的代码。因为,我从未研究过这种“ response.setHeader”方法。

<%
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragma","no-cache"); 
response.setHeader ("Expires", "0"); //prevents caching at the proxy server
%>

or any other methods are available for disabling back button in JSP after Logging in? 还是有其他方法可用于在登录后禁用JSP中的后退按钮?

If you want to restrict the user to go back then try this small script. 如果要限制用户返回,请尝试使用此小脚本。

<script>
    history.forward();
</script>

Put this code into the <head> element of your page and try to go back. 将此代码放入页面的<head>元素中,然后尝试返回。 For more details click on following link... 有关更多详细信息,请单击以下链接...

How to disable browser back button after logout in JSP? 在JSP中注销后如何禁用浏览器后退按钮?

This code sets response headers. 此代码设置响应头。 Headers is http feature, http://en.wikipedia.org/wiki/List_of_HTTP_header_fields This code just works this in Java. 标头是http功能, http://en.wikipedia.org/wiki/List_of_HTTP_header_fields此代码仅在Java中起作用。

您可以使用JavaScript进行此操作,例如,要求用户不要离开页面。

window.onbeforeunload = function() { return "You work will be lost."; };

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM