myeclipse+tomcat includejsp文件时错误如下

feiyunzaipiao 2010-10-15 11:07:06
Fragment "cond.jsp" was not be found at expected path /MyWeb/WebRoot/cond.jsp
这是提示出来的错误,希望各位大虾可以帮助解决下
...全文
137 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
feiyunzaipiao 2010-10-18
  • 打赏
  • 举报
回复
大小写都没错,路径就是放在webroot文件夹里面,文件路径是D:\Program Files\workspace\MyWeb\WebRoot


基本上是默认代码,就body里面加了个include。。
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
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 'MyJsp.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>
This is my JSP page. <br>
<%@ include file="cond.jsp"%>
</body>
</html>

MyWeb
src文件夹
jre system library
j2ee1.4libraries
webroot文件夹
meta-inf
web-inf
index.jsp
MyJsp.jsp
这就是目录结构
feiyunzaipiao 2010-10-17
  • 打赏
  • 举报
回复
MyWeb
src文件夹
jre system library
j2ee1.4libraries
webroot文件夹
meta-inf
web-inf
index.jsp
MyJsp.jsp
这就是目录结构
feiyunzaipiao 2010-10-17
  • 打赏
  • 举报
回复
大小写都没错,路径就是放在webroot文件夹里面,文件路径是D:\Program Files\workspace\MyWeb\WebRoot


基本上是默认代码,就body里面加了个include。。
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
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 'MyJsp.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>
This is my JSP page. <br>
<%@ include file="cond.jsp"%>
</body>
</html>
hack_ccsl 2010-10-15
  • 打赏
  • 举报
回复
贴项目目录结构。 include cond.jsp 的文件代码。
acj14591 2010-10-15
  • 打赏
  • 举报
回复
在指定的路径下面没有找到cond.jsp文件,请检查路径是否正确,目标文件是否存在,注意大小写!

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧