在jsp页面中隐藏地址栏和状态栏

时间:2009-03-17 09:47:48

标签: jsp

我需要隐藏jsp页面的地址栏和状态栏,“demo.jsp”

我的代码是

 <html>
 <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Welcome</title>
</head>

    <frameset cols="10%,90%">
        <frame src="actions.jsp" name="page1"></frame>
        <frame src="default.jsp" name="page2"></frame>
    </frameset>

</html>
all i need to do is display the same page without address bar and status bar.

我试过

window.open(“login.jsp”,“eTIMS”,“toolbar = 0,location = 0,directories = 0,status = 0,menubar = 0,scrollbars = 1,resizable = 0,width = 1014,同一页面内的height = 714,left = 0,top = 0“)。但它不断迭代。前一页仍然存在。我也不知道如何关闭上一页。  任何解决方案?

更多信息:

是我的jsp页面,我通过访问数据库检查用户名和密码。我使用&lt;%if(EmpBean.login()== 0){response.sendRedirect(“welcome.jsp”)验证这一点; } else {response.sendRedirect(“login.jsp?ch = 2”);}%&gt;如果正确则转到welcome.jsp。

我不希望welcome.jsp的用户返回我的登录页面。我想尽可能保持抽象。请帮我机智。

4 个答案:

答案 0 :(得分:1)

你正在尝试的是不可能的。您无法使用javascript关闭未打开的窗口。你肯定无法控制我的浏览器如何显示我已经打开的窗口

答案 1 :(得分:1)

Gareth是对的,你根本不能这样做,至少对所有浏览器都是如此:例如,Firefox总是会显示菜单栏和状态栏,至少作为安全功能(所以你不能伪装成Web)窗口作为系统窗口)并且还允许用户保持控制 此外,我没有看到这样做会阻止返回(点击Backspace,使用上下文菜单等)。

您无法阻止用户返回(浏览器)历史记录,许多人尝试过没有成功,并且您将不再找到禁止此用户的网站。你应该尝试另一种方法来解决这个问题。

此外,因为你生成页面,你应该做一个无框架设计:使用框架是这样的 - 二十世纪...... :-)搜索网络,看看为什么使用框架是一个坏主意,至少对于可用性原因。

答案 2 :(得分:0)

http://labs.mozilla.com/prism/

Prism是一种有趣的方法,它本质上是一个没有任何任务栏的浏览器。

答案 3 :(得分:0)

window.open(document.location+'?newwin=true',name,'fullscreen=no,width=1000%,height=700,toolbar=no,menubar=no,statusbar=no,scrollbars=yes,addressbar=no,resizable=yes,directories=no,location=no,left=' + left + ',top=' + top);