我的TOMCAT的安装目录为D:\program files\Apache Software Foundation\Tomcat 6.0
classpath为CLASSPATH=D:\program files\Java\jdk1.6.0_03\lib\tools.jar;d:\a;D:\program files\Apache
Software Foundation\Tomcat 6.0\lib\servlet-api.jar
classpath的设置应该是没有问题呀。
我编译好了一个类HelloServlet.class并将其放在
D:\program files\Apache Software Foundation\Tomcat 6.0\webapps\ROOT\WEB-INF\classes
目录下,
TOMCAT服务器出于开启状态,
我在浏览器中打开http://localhost:8080/server/HelloServlet
确得到一个错误如下:
(端口8080是对的)HTTP Status 404 - /servlet/HelloServlet--------------------------------------------------------------------------------type Status reportmessage /servlet/HelloServletdescription The requested resource (/servlet/HelloServlet) is not available.
--------------------------------------------------------------------------------Apache Tomcat/6.0.13
请各位高手解惑!小弟先谢过!
解决方案 »
- servlet 属性取值问题。。。
- 高分求解释:为什么项目win环境下就OK,在linux 下启动就报错。
- 高手指教:在Win7上用VPN出现Reason 442:Failed to enable Virtual Adpater
- 问一个.xml文件存放路径的问题
- 我web.xml的<error-page>页面为什么出来是乱码啊?困惑!!请高手帮忙!
- 我用 Jbuilder9+Weblogic8.1开发web程序,在客户端的浏览器中要装jvm吗?
- 请教 我带包的jsp无法调用servlet而没有包直接在目录下的jsp却可以??
- 有关一个asp的网站改建成jsp的问题,请各位指点!
- 关于做网页的价格
- springMVC框架对实体bean的处理问题
- 神奇的TOMCAT
- 新手从.NET转JAVA的菜鸟问题?
http://family168.com/tutorial/jsp/html/jsp-ch-06.html#jsp-ch-06-01
你的TOM6是安装版的还是解压版的?
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5"> <display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description><servlet>
<servlet-name>HelloServlet</servlet-name>
<display-name>HelloServlet</display-name>
<description>A test Servlet</description>
<servlet-class>HelloServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloServlet</servlet-name>
<url-pattern>/HelloServlet</url-pattern>
</servlet-mapping>
</web-app>
请各位大侠帮忙看下.谢谢各位.
而你的WEB。XML是<url-pattern>/HelloServlet </url-pattern>