现在是这样一个情况,左边的FRAME是菜单,含有很多链接,右边的FRAME是点击链接后显示的内容(就像CSDN论坛一样),现在要做的是,当SESSION有效的情况下,点链接可以正常显示右边的内容,但是当SESSION失效的情况下,返回单独一个LOGIN画面,由于现在链接的TARGET指定的是右边的FRAME,所以现在即使返回到LOGIN画面也是显示在右边,不知道有什么办法可以解决?
解决方案 »
- jsp中根据选择的下拉框中选择的值,后面自动出现对应该值的信息
- 求一用JSP编写的图书管理系统源程序,最好用的MySQL数据库!!!
- 问一下,怎么能实现从数据库里面取出来的数据分几行几列显示?
- 使用prepareStatement如何做到模糊查询?
- 我将把对数据库的操作都写在jsp页面里了,该怎么分离出来呢?
- jboss出错,请教原因及解决方案
- servlet小问题!高手请勿进!^_^
- request.getRealPath("???")的参数???是什么?
- import java.io.*;
- tomcat运行一段时间会退出,谁帮我看看这个错误日志
- 浏览器端文件的导入显示问题?
- 如何解决当FORM的ENCTYPE="multipart/form-data" 时request.getParameter()获取不到值的方法
window.open("<%=request.getContextPath()%>/login.do","_parent","");
window.top.location.href="http://www.china.com";
</script>
这里怎么用js?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Untitled Document</title>
</head><frameset cols="*,*" frameborder="YES" border="2" framespacing="2">
<frame src="left.htm" name="leftFrame" >
<frame src="right.htm" name="mainFrame">
</frameset>
<noframes><body>
</body></noframes>
</html>left.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Untitled Document</title>
</head><body>
<!--当然这里要先看session-->
<a href="#" onclick="window.open('login.html','_parent','');">111</a>
<br><a href="#" onclick="window.open('login.html','mainFrame','');">222</a>
</body>
</html>
if(session.getAttribure("你的属性")==null){
>%
<script>
window.open("login.jsp","_parent","");
</script>
<%
}
%>或者写一个checksession.jsp在每个页中include
<script language="javascript">
if (top.location !== self.location){
top.location=self.location;
}
</script>
<script language="javascript">
if (top.location !== self.location){
top.location=self.location;
}
</script>
这样当Login.jsp发现它的上面是框架的时候就会自动跳出,我写的程序都是这样的
parent.window.location.href="login.html"
</script>