欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

frameset布局时frame中src路径的页面没有加载的解决方法

程序员文章站 2023-11-24 22:34:46
解决方法:将页面的body节点去掉,错误代码如下 复制代码 代码如下: <%@ page language="java" contenttype="text/html...
解决方法:将页面的body节点去掉,错误代码如下
复制代码 代码如下:

<%@ page language="java" contenttype="text/html; charset=gb18030"
pageencoding="gb18030"%>
<%
string path = request.getcontextpath();
string basepath = request.getscheme()+"://"+request.getservername()+":"+request.getserverport()+path+"/";
%>
<!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd">
<html>
<head>
<base href="<%=basepath%>">
<meta http-equiv="content-type" content="text/html; charset=gb18030">
<title>主页</title>
</head>
<body>
<frameset rows="15%,70%,15%" frameborder="yes" >
<frame scrolling="auto" src="indextop.jsp"></frame>
<frame scrolling="auto" src="indexmain.jsp"></frame>
<frame scrolling="auto" src="indexbottom.jsp"></frame>
</frameset>
</body>
</html>

由于frameset是一种框架结构,将整个页面占据掉,不要用body进行布局