新手请教:为什么这个文件不能命名为index.jsp?“ ... is not available”

L-ma 2003-08-22 04:38:20
开发环境jdk1.4.2+apache2.0.47+tomcat5.0.3+mod_jk2.0.46
这是我的关于用户注册的源代码:(e:\myjsp\index.jsp)
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>请您注册</title>
</head>

<body>
<jsp:include page="patch/head.htm"/>
<jsp:include page="log.jsp" flush="true"/>
<jsp:include page="patch/bottom.htm"/>

</body>
</html>

为什么这个文件取其他的名字都可以正常显示,单单取名为index.jsp总报错:
HTTP Status 404 - Servlet org.apache.jsp.index_jsp is not available

--------------------------------------------------------------------------------

type Status report

message Servlet org.apache.jsp.index_jsp is not available

description The requested resource (Servlet org.apache.jsp.index_jsp is not available) is not available.


--------------------------------------------------------------------------------

Apache Tomcat/5.0.4
...全文
110 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
redv 2003-09-03
  • 打赏
  • 举报
回复
晕,买本书系统地学学吧。
L-ma 2003-09-03
  • 打赏
  • 举报
回复
为什么没人回答?
明行 2003-08-26
  • 打赏
  • 举报
回复
我也是碰到这个问题:
我填加了虚拟目录,在这个目录下的log.jsp我都可以访问操作,可是index.jsp有错。
改为index.htm就对了,为什么?
petalrain 2003-08-26
  • 打赏
  • 举报
回复
.XML是配置文件
L-ma 2003-08-26
  • 打赏
  • 举报
回复
这位大哥,你说的没错,注释掉是可以。
但是为什么要注释掉啊,以后会有什么问题没有。
这个web.xml文件事干什么用的,是不是每个WEB-INF里都要有一个web.xml文件啊???
yixf 2003-08-22
  • 打赏
  • 举报
回复
你把webapps\ROOT\WEB-INF里的web.xml里的
<servlet>
<servlet-name>org.apache.jsp.index_jsp</servlet-name>
<servlet-class>org.apache.jsp.index_jsp</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>org.apache.jsp.index_jsp</servlet-name>
<url-pattern>/index.jsp</url-pattern>
</servlet-mapping>
注释掉试试,我是这么做得

81,091

社区成员

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

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