web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
  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">
<servlet>
        <servlet-name>Hello</servlet-name>
        <servlet-class>Hello</servlet-class>
    </servlet>    <servlet-mapping>
        <servlet-name>Hello</servlet-name>
        <url-pattern>/servlet/Hello</url-pattern>
    </servlet-mapping></web-app>

解决方案 »

  1.   

    http://127.0.0.1:8000/test/这是首页
    打开这个地址就出现了404错误
    谢谢楼上的
      

  2.   

    解决了
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
      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>
    Jsp servlet
    </description>
    <servlet>
            <servlet-name>simple</servlet-name>
            <servlet-class>simple</servlet-class>
        </servlet>    <servlet-mapping>
            <servlet-name>simple</servlet-name>
            <url-pattern>/simple</url-pattern>
        </servlet-mapping></web-app>