用eclipse写 jsp include file 路径问题
有两个html文件:top.html与bottom.html,代码分别如下:top.html<html><head><metahttp-equiv="Content-Ty...
有两个html文件:top.html与bottom.html,代码分别如下:
top.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
我是top
</body>
</html>
bottom.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
我是bottom
</body>
</html>
用eclipse建立项目:htmltest,JSP文件为main.jsp,代码如下:
<%@ page contentType="text/html;charset=GB2312" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%@ include file="top.html" %>
<p>我是jsp内容</p>
<%@ include file="top.html" %>
</body>
</html>
我把两个html文件放在了:
D:\JSpworkspace\htmltest\WebContent 目录下,而main.jsp也在此。运行提示:
org.apache.jasper.JasperException: /main.jsp(10,0) File "/top.html" not found
请问是哪个环节错了?谢谢 展开
top.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
我是top
</body>
</html>
bottom.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
我是bottom
</body>
</html>
用eclipse建立项目:htmltest,JSP文件为main.jsp,代码如下:
<%@ page contentType="text/html;charset=GB2312" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%@ include file="top.html" %>
<p>我是jsp内容</p>
<%@ include file="top.html" %>
</body>
</html>
我把两个html文件放在了:
D:\JSpworkspace\htmltest\WebContent 目录下,而main.jsp也在此。运行提示:
org.apache.jasper.JasperException: /main.jsp(10,0) File "/top.html" not found
请问是哪个环节错了?谢谢 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询