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

解决方案 »

  1.   

    我在struts2的配置如下:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
    <struts><package name="default"  namespace="/" extends="strusts-default">
    <default-action-ref name="defaultAction" />
    <action name="defaultAction">
    <result>index.jsp</result>
    </action>

    <action name="register" class="userAction"
    method="register">
    <result type="success">/index.jsp</result>
    </action> 

    <action name="login" class="userAction" method="login">
    <result type="redirectAction">${nextUser}</result>
    </action>
    <action name="common" class="cOrm" method="Common">
    <result name="success">index.jsp</result>
    </action>
    <action name="manager" class="cOrm" method="Manager">
    <result name="success"></result>
    </action>

    <action name="cardAction" class="CardAction" method="Cardinfo">
    <result name="success">/product.jsp</result>
    </action>

    <action name=""></action>
    </package>
    </struts>    
      

  2.   

    跳转的Action 我已经写了 为什么说我找不到呢?
      

  3.   

    你是如何访问的?按你的配置,应该访问 HOST/default才对;
    还有检查一下 defaultAction 这个是否已经配置?
      

  4.   

    <bean id="CardAction" class="com.wc.action.CardAction" scope="prototype">
    <property name="cardService" ref="CardService"></property>
    </bean>
    上面是spring里面配置好的Action的。
     <li class="li"><a href="cardAction.action">产品列表</a></li>
    这是我点击需要跳转的请求,当点击产品就报错了。
      

  5.   

     <filter-mapping>
       <filter-name>struts2</filter-name>
       <url-pattern>*.action</url-pattern>
      </filter-mapping>
    这是web的配置
      

  6.   

    应该是你配置的action没有找到。。
      

  7.   

    <action name=""></action>删掉
      

  8.   


    /**
     * 菜单action
     * @version 1.0
     */
    @ActionBean(name = "/admin/privilege", interceptor = "mightRoleInter")
    public class MenuAction extends CoreAction {

    private static final Logger log = LoggerFactory.getLogger(MenuAction.class);
    private static final String LIST = "/above/sys/menu/list.jsp";

    /**
     * 列表页面
     * @return
     */
    public String list() {
    log.info("权限菜单管理");
    return LIST;
    }}
    全部用注解,别去配置了
      

  9.   

    这样注解后,在浏览器
    输入:http://localhost:8080/projectName 访问到了首页,
    输入: http://localhost:8080/projectName/admin/privilege 就访问到了这个action
    输入: http://localhost:8080/projectName/admin/privilege/list.do 就访问到了这个方法
    interceptor = "mightRoleInter" 表示访问这个action必须通过的拦截器,也是注解!把.xml这样的文件删掉,留着也无用,反而占地方,烦得很!