jsp页面为什么打不开

来源:百度知道 编辑:UC知道 时间:2024/07/02 15:40:43
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
</body>
</html>
这是http://localhost:8080/2/Untitled-1.jsp的代码,我的端口是设的8080
但我把Tomcat中的ROOT文件夹拷过来却可用http://localhost:8080/ 是服务器运行的的根目录,myapp 是根目录下的一个子目录,,而你的配置文件将Context path 设置为"/first",是不正确的,,如果你将first下的WebRoot改为“ROOT”tomcat会自动运行这个目录下的程序,而不需要你的设定;

注:
<Context path="/first" docBase="C:\Documents and Settings\Administrator\workspace\firs\WebRoot" reloadable="true"/>
中的\firs\WebRoot串中希望没有笔误啊

一般在eclipse工程中,会将context定义为webroot,而tomcat中默认会执行名称为ROOT下的页面,所以,造成了此冲突