当前位置:编程学习 > JAVA >>

HTTP Status 404 description The requested resource is not available

eclipse里用tomcat服务器运行servlet文件出现404错误,不知道路径哪里出错了?



路径:
--------------------编程问答-------------------- web.xml 里没有配置该servelet吗? --------------------编程问答-------------------- web.xml代码:
<?xml version="1.0" encoding="UTF-8"?>  
<web-app version="2.5" 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">  
    <servlet>  
        <servlet-name>coreServlet</servlet-name>  
        <servlet-class>  
            org.liufeng.course.servlet.CoreServlet  
        </servlet-class>  
    </servlet>  
  
    <!-- url-pattern中配置的/coreServlet用于指定该Servlet的访问路径 -->  
    <servlet-mapping>  
        <servlet-name>coreServlet</servlet-name>  
        <url-pattern>/coreServlet</url-pattern>  
    </servlet-mapping>  
  
    <welcome-file-list>  
        <welcome-file>index.jsp</welcome-file>  
    </welcome-file-list>  
</web-app>   --------------------编程问答-------------------- 有你这样发布的吗??
http://localhost:8080/项目名 应该这样写
--------------------编程问答-------------------- 项目名没有 ,项目名/servlet名称 --------------------编程问答-------------------- 应该是http://localhost:8080/webapps/coreServlet
这样吧? --------------------编程问答-------------------- http://localhost:8080/webapps/coreServlet
你图片中的那个路径哪里的? --------------------编程问答--------------------
引用 6 楼 longtian1213 的回复:
http://localhost:8080/webapps/coreServlet
你图片中的那个路径哪里的?

应该是这样的!
补充:Java ,  Web 开发
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,