日期:2014-05-17  浏览次数:20737 次

散分啦,一个最最简单的用jsp做一个网页框架的小问题
源码如下:
<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<frameset rows="110,570" cols="*">
  <frame src="../WebRoot/MyHtml.html" />
  <frameset rows="*" cols="309,1102">
  <frame src="../WebRoot/Left.jsp" />
  <frame src="../WebRoot/Right.jsp" />
  </frameset>
  
</frameset>
</html>
其中MyHtml,Left.jsp,Right.jsp都是新建的没有任何改动
位什么用浏览器访问这个页面显示不出来呢:
错误如下:
The requested resource (/WebRoot/MyHtml.html) is not available.
The requested resource (/WebRoot/Left.jsp) is not available.
The requested resource (/WebRoot/Right.jsp) is not available.

------解决方案--------------------
frame引用的那几个jsp,html路径不正确
------解决方案--------------------
找不到,路径不对
------解决方案--------------------
<frame src="MyHtml.html" />
 直接这样试试。
------解决方案--------------------
WebRoot是eclipse生成的WEB项目目录,真正运行时是发布到TOMCAT下的,所以,你应该看发布到TOMCAT下的目录结构,去掉WebRoot应该就对了