HTTP Status 404 - There is no Action mapped for namespace / and action name add.--------------------------------------------------------------------------------type Status reportmessage There is no Action mapped for namespace / and action name add.description The requested resource (There is no Action mapped for namespace / and action name add.) is not available.
--------------------------------------------------------------------------------

解决方案 »

  1.   

    <?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.objectFactory" value="spring"/>   
    <package name="employee" extends="struts-default" namespace="/emp">
    <action name="add" class="addBean" method="add">
    <result type="redirect">list.action</result>
    <result name="input">/emp/add.jsp</result>
    </action>
    <action name="list" class="listBean" method="list">
    <result name="success">/emp/list.jsp</result>
    <result name="input">/emp/add.jsp</result>
    </action>
    </package>
    </struts>
      

  2.   

    <bean id="addBean" class="com.test.action.EmployeeAction" scope="prototype">
        <property name="employeeManager">
                <ref bean="employeeManager" />
        </property>
    </bean>
      

  3.   

    上面是struts.xml和applicationContext.xml文件中的配置。
      

  4.   

    message There is no Action mapped for namespace / and action name add
    在路径/下没有add这个action
    访问应该是serverName/emp/add
      

  5.   

    该说的都让楼上说了,我说一个容易犯错的吧,就是确保你的struts文件是放在src要目录下的。
      

  6.   

    src根目录下的,五笔有问题,打错字,晕。