---
title: "there is no action mapped for namespace / and action name解决办法"
author: "duyunfengsolo"
date: "2009-12-14T13:46:51Z"
tags: []
categories: ["企业架构"]
slug: "there-is-no-action-mapped-for-namespace-and-action-name"
draft: false
lastmod: "2009-12-16T14:32:48Z"
id: 548054
url: "https://solodu.iteye.com/blog/548054"
---

```
1.-----首先查看你的struts.xml 文件是否在src目录下；

2.-----检查struts.xml文件的语法是否正确： 

               如果1正确的话那就一定是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>
 <package name="struts2" extends="struts-default">
 
  <action name="login" class="com.test.action.LoginAction">
  <result name="success">/result.jsp</result>
  </action>
 </package>
</struts>   
          那么就只有是红字的部分写错了 查看你的是否吧struts-default中间的“-”错写成了struts=default；

```

 

    我的属于第一种。因为刚开始学这两个框架的整合，不知道struts.xml放到什么地方，我放到了WEB-INF下面了，所以找不到，所以应该是放到src下面，即时在src下面建了个conf个目录，放到它里面也能被struts认识(找)到。