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

解决方案 »

  1.   

    web.xml 里没有配置该servelet吗?
      

  2.   

    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>
      
      

  3.   

    有你这样发布的吗??
    http://localhost:8080/项目名 应该这样写
      

  4.   

    项目名没有 ,项目名/servlet名称
      

  5.   

    应该是http://localhost:8080/webapps/coreServlet
    这样吧?
      

  6.   

    http://localhost:8080/webapps/coreServlet
    你图片中的那个路径哪里的?