frameset布局時(shí)frame中src路徑的頁(yè)面沒有加載的解決方法
更新時(shí)間:2013年10月28日 16:30:40 作者:
使用frameset布局時(shí),frame 中src路徑的頁(yè)面沒有加載的情況,想必大家都有感觸吧,下面是具體的解決方法,感興趣的朋友可以參考下
解決方法:將頁(yè)面的body節(jié)點(diǎn)去掉,錯(cuò)誤代碼如下
<%@ 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>主頁(yè)</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是一種框架結(jié)構(gòu),將整個(gè)頁(yè)面占據(jù)掉,不要用body進(jìn)行布局
復(fù)制代碼 代碼如下:
<%@ 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>主頁(yè)</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是一種框架結(jié)構(gòu),將整個(gè)頁(yè)面占據(jù)掉,不要用body進(jìn)行布局
相關(guān)文章
SSH整合中 hibernate托管給Spring得到SessionFactory
Spring文件中的 SessionFactory中 加入為了能得到同一個(gè)Session2009-06-06
JSP之表單提交get和post的區(qū)別詳解及實(shí)例
這篇文章主要介紹了JSP之表單提交get和post的詳解及實(shí)例的相關(guān)資料,希望通過本文大家能夠掌握使用get與post的方法,需要的朋友可以參考下2017-09-09
JSP 開發(fā)之servlet中調(diào)用注入spring管理的dao
這篇文章主要介紹了JSP 開發(fā)之servlet中調(diào)用注入spring管理的dao的相關(guān)資料,需要的朋友可以參考下2017-05-05
jsp簡(jiǎn)單連接SQL Server2000數(shù)據(jù)庫(kù)的方法
這篇文章主要介紹了jsp簡(jiǎn)單連接SQL Server2000數(shù)據(jù)庫(kù)的方法,較為詳細(xì)的分析了JSP連接SQL Server2000數(shù)據(jù)庫(kù)的相關(guān)設(shè)置技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-10-10

