用的MyEclipse7.5;tomcat6.0;jdk5.0
tomcat和jdk都配置了
不论是单独启动还是在MyEclipse中tomcat能正常启动,但是在运行项目的时候却出现404错误
错误提示:
description :The requested resource is not available.

解决方案 »

  1.   

    你请求地址的路径不对,或者相应的action路径配置path没有在配置文件中找到
      

  2.   

    servlet没有配置正确
    查看web.xml确认正确,以及自己的请求路径正确 
      

  3.   

    http://localhost:8080
    能出现猫的网页吗404  路径错误
      

  4.   

    部署的时候,不要web-info对拷,先export成一个war,然后扔到webapps下面,基本不会错。
    如果你是export,看看对应的配置文件有没有打包进去
      

  5.   

    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">
      <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
        <filter>
            <filter-name>struts2</filter-name>
            <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
        </filter>    <filter-mapping>
            <filter-name>struts2</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
      
    </web-app>
      

  6.   

    我感觉问题出在Action和Struts上,说你requested的资源不可用,应该是出在这2个方面,你好好看看配置文件,
      

  7.   

    <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter </filter-class> 换个试试
    或者是tomcat6.0的配置出了问题
      

  8.   

    看你的struts配置文件是否正确 或某个名字是否写错了
      

  9.   

    把struts的配置文件贴出来看看配置文件有问题 ,没找对目录。
      

  10.   

    最基础的项目
    项目名Struts2_0100
    struts.xml<?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC
        "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
        "http://struts.apache.org/dtds/struts-2.0.dtd"><struts>
        <constant name="struts.devMode" value="true" />
         <package name="default" namespace="/" extends="struts-default">
            <action name="hello">
                <result>
                    /Hello.jsp
                </result>
            </action>
        </package></struts>用http://localhost:8080/能出现三条腿的猫,
    但是http://localhost:8080/Struts2_0100/hello就提示404错误
      

  11.   

    http://localhost:8080/Struts2_0100/hello.action 试试看
      

  12.   


    还是不行。请问要是在MyEclipse下生成,能够执行的话是不是在tomcat的webapps文件夹下会有相应的项目的配置文件啊,谢谢您
      

  13.   

    起码WEB-INF里面那堆class以及lib/*.jar以及****.xml是应该有的吧
      

  14.   

    我也觉得是tomcat6.0的配置出了问题
    环境变量都配好了,不知道tomcat6.0自身的文件做什么改动,请各位大侠指点
      

  15.   

    看看你的tomcat里面的conf/server.xml里面的最下面的那个</Host> 前面有没有类似
     <Context docBase="Struts2_0100" path="/Struts2_0100" reloadable="true" />之类的,没有就加上
      

  16.   

    要不你的路径不对  写错了    要不就是项目的名字和在tomcat路径webroot下的不一致   比如copy项目时会出现这个情况..
      

  17.   

    我tomcat装在C:\Program Files下
    MyEclipse的工作目录在D:\workpace
    哪位能帮忙看一下tomcat里面的conf/server.xml
    <Context docBase="D:/workpace/Struts2_0100" path="/Struts2_0100" reloadable="true"/>
    具体怎么写,小弟倒腾了半天tomcat都有错误
      

  18.   

    把项目删了重建  有时myeclipse会出现一些莫名的异常   试试看吧
      

  19.   

    好,我试试吧
    杯具的是我前几天myeclipse是6.0的时候就出这个错,现在是7.5还是错
    谢了
      

  20.   

    我tomcat装在C:\Program Files下 
    MyEclipse的工作目录在D:\workpace 
    哪位能帮忙看一下tomcat里面的conf/server.xml 
    <Context docBase="D:/workpace/Struts2_0100" path="/Struts2_0100" reloadable="true"/> 
    具体怎么写,小弟倒腾了半天tomcat都有错误,太菜了
      

  21.   

    哪位能帮忙看一下tomcat里面的conf/server.xml 
    <Context docBase="D:/workpace/Struts2_0100" path="/Struts2_0100" reloadable="true"/>
    这句话怎么写?我tomcat装在C:\Program Files下 
    MyEclipse的工作目录在D:\workpace 
      

  22.   

    哪位能帮忙看一下tomcat里面的conf/server.xml 
    <Context docBase="D:/workpace/Struts2_0100" path="/Struts2_0100" reloadable="true"/>
    这句话怎么写?我tomcat装在C:\Program Files下 
    MyEclipse的工作目录在D:\workpace 
      

  23.   

    哪位能帮忙看一下tomcat里面的conf/server.xml 
    <Context docBase="D:/workpace/Struts2_0100" path="/Struts2_0100" reloadable="true"/>
    这句话怎么写?我tomcat装在C:\Program Files下 
    MyEclipse的工作目录在D:\workpace 
      

  24.   

    改成这个试试
    <Context docBase="D:/workpace/Struts2_0100" path="/Struts2_0100" reloadable="true" crossContext="true"/>
    另为你看下你的这个文件的名字是不是ROOT.xml是不是tomca的conf中
    如果是的话:以tomcat默认端口为:8080为例
    请求index.jsp路径应该为 http://localhost:8080/  
      

  25.   

    如若还不行用这个
    <Context path="" docBase="D:/workpace/Struts2_0100/WebRoot" reloadable="true" crossContext="true"/>
      

  26.   

    不好意思我没细看:
    路径是:\conf\Catalina\localhost\ROOT.xml
      

  27.   

    我又用MyEclipse建了一个项目 名叫Struts2_0200,依然保存在D:\workpace 下
    我试着改成<Context path="" docBase="D:/workpace/Struts2_0200/WebRoot" reloadable="true" crossContext="true"/>
    然后http://localhost:8080/没问题
    http://localhost:8080/Struts2_0200/index.action又显示404了
    嘿嘿,麻烦您在指导一下吧另外我以后都要存盘在D:\workpace 下能不能写一条不用总改的语句啊
    谢了
      

  28.   

    我也有类似的问题,能不能帮我看看http://topic.csdn.net/u/20110810/19/7d27756e-eb95-455b-88ec-af1d36b5f2d5.html