小弟做了3个页面,menu.jsp,list.jsp,copyright.jsp!
然后把它们3个都放在index.jsp中,代码如下:<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
--> </head>
<body>
<table width=800 align="center">
<tr>
<td><%@include file="menu.jsp" %></td> //这里会报错~~~menu.jsp
</tr>
<tr>
<td><br></td>
</tr>
<tr>
<td><br></td>
</tr>
<tr>
<Td><%@include file="list.jsp" %></Td> //这里也会报错~~~menu.jsp </tr>
<tr>
<td align="center"><%@include file="copyright.jsp" %></td> //这里也会报错copyright.jsp
</tr>
</table>
</body>
</html>
请问为什么啊???? 报错信息好象和<base href="<%=basePath%>">有关~~
然后把它们3个都放在index.jsp中,代码如下:<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
--> </head>
<body>
<table width=800 align="center">
<tr>
<td><%@include file="menu.jsp" %></td> //这里会报错~~~menu.jsp
</tr>
<tr>
<td><br></td>
</tr>
<tr>
<td><br></td>
</tr>
<tr>
<Td><%@include file="list.jsp" %></Td> //这里也会报错~~~menu.jsp </tr>
<tr>
<td align="center"><%@include file="copyright.jsp" %></td> //这里也会报错copyright.jsp
</tr>
</table>
</body>
</html>
请问为什么啊???? 报错信息好象和<base href="<%=basePath%>">有关~~
<%@include file="menu.jsp" %><%@ include file="menu.jsp" %>
所以你在被包含的文件上不要出现在HTML的头标签和除了body之间的能用标签