Topic: 问个tomcat5.0的问题

  Print this page

1.问个tomcat5.0的问题 Copy to clipboard
Posted by: everyone
Posted on: 2005-03-22 19:45

我按网上那个教程装完后
测试8080就一切正常
但是测试HelloWorld那个servlet的时候
就出现如下信息

  HTTP Status 404 - /servlet/HelloWorld
  --------------------------------------------------------------------------------
  type Status report
  message /servlet/HelloWorld
  description The requested resource (/servlet/HelloWorld) is not available.
  --------------------------------------------------------------------------------
  Apache Tomcat/5.0.28

是我在web.xml的添加不正确还是什么?
下面这段的正确完整添加格式是怎样的?
   <servlet>
   <servlet-name>HelloWorld</servlet-name>
   <servlet-class>HelloWorld</servlet-class>
   </servlet>
   <servlet-mapping>
   <servlet-name>HelloWorld</servlet-name>
   <url-pattern>/servlet/helloworld</url-pattern>
   </servlet-mapping>

2.Re:问个tomcat5.0的问题 [Re: everyone] Copy to clipboard
Posted by: everyone
Posted on: 2005-03-22 20:32

里面现在是这样的,怎么添加?

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">

<display-name>Welcome to Tomcat</display-name>
<description>
HelloWorld
</description>

<!-- JSPC servlet mappings start -->

<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>
<!-- JSPC servlet mappings end -->

</web-app>

3.Re:问个tomcat5.0的问题 [Re: everyone] Copy to clipboard
Posted by: leowu2000
Posted on: 2005-03-23 09:02

HTTP Status 404 - /servlet/HelloWorld

<url-pattern>/servlet/helloworld</url-pattern>

windows下边呆久了,就忘记大小写了。


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923