myeclipse+tomcat includejsp文件时错误如下 Fragment "cond.jsp" was not be found at expected path /MyWeb/WebRoot/cond.jsp这是提示出来的错误,希望各位大虾可以帮助解决下 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在指定的路径下面没有找到cond.jsp文件,请检查路径是否正确,目标文件是否存在,注意大小写! 贴项目目录结构。 include cond.jsp 的文件代码。 大小写都没错,路径就是放在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> MyWebsrc文件夹jre system libraryj2ee1.4librarieswebroot文件夹 meta-inf web-inf index.jsp MyJsp.jsp这就是目录结构 大小写都没错,路径就是放在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> MyWebsrc文件夹jre system libraryj2ee1.4librarieswebroot文件夹 meta-inf web-inf index.jsp MyJsp.jsp这就是目录结构 一个增加数据的页面 要用到上传文件 纠结死了 大大帮我看下。 乐观锁问题。。。 fckeditor的问题 JSP 的 cookie 得到的值问题、 Java Web项目如何做版本控制?(不知道有没有人研究过) 打包成war后要如何读取包中的文件 JAVA学习QQ群4527614 有关<<调试servlet出错>> java程序实现图片背景透明的功能 jsp的forward的参数直怎么传不过去啊 如何回复邮箱。 SSH 配置成功 数据库无数据
基本上是默认代码,就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>
src文件夹
jre system library
j2ee1.4libraries
webroot文件夹
meta-inf
web-inf
index.jsp
MyJsp.jsp
这就是目录结构
基本上是默认代码,就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
这就是目录结构