关于Struts2中的错误:例如There is no Action mapped for namespace / and action name product-input.

   

        在配置struts.xml 文件时,会出现  

 There is no Action mapped for namespace / and action name ....    意思是没有product-input的映射文件或者是命名空间

      出现这样的错误的原因后:

    做如下检查:  

        1: 把struts.xml中的namespace="/"改成namespace=""或者去除,使用默认的命名空间。

2: struts.xml配置文件的位置,是否在src下。

3: struts.xml的拼写是否正确

4: package中的 name="struts2"建议struts2改成别的名字,这样容易引起冲突

检查好以上的步骤之后,还是 There is no Action mapped for namespace / and action name .... 这样的错误。那么就要检查编译后的struts.xml文件是否在WEB-INF目录下

有些IDE默认编译后文件的存放目录是在build下,这样子找不到struts.xml,报如上的错误也是正常的

关于更改eclipse web 项目默认编译输出路径:

eclipse中只能针对项目更改,因为其默认的是build目录下的,只能以项目更改项目右键 -》properties -》Java Build Path -》source -》Default output folder,选择

还有一种更方便的。因为出现这种错误往往是最开始的时候,可以重新创建个项目。好处很多:最重要的一点是在更改默认编译输出路径时可能会文件丢失的情况。

更改方法如下:

第一张图是默认情况下的设置,第二张图是我修改后的。

就是这样子。。有啥问题可以给我留言,谢谢



时间: 2024-08-05 18:24:46

关于Struts2中的错误:例如There is no Action mapped for namespace / and action name product-input.的相关文章

struts2中错误There is no Action mapped for namespace [/] and action name [] associated with context path

1 There is no Action mapped for namespace [/] and action name [] associated with context path [/Struts2_0300_Action2]. - [unknown location] 2 at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185) 3 at org.apache.struts2.i

Struts2中关于"There is no Action mapped for namespace / and action name"的总结

今天在调试一个基础的Struts2框架小程序.总是提示"There is no Action mapped for namespace / and action name"的错误.上网查询后发现这是一个初学者经常碰到的问题,导致错误的原因主要有两种.总结如下: 一.struts.xml文件错误.这种错误又分为以下几种:1,struts.xml文件名错误.一定要注意拼写问 题:2,struts.xml文件放置路径错误.一定要将此文件放置在src目录下.编译成功后,要确认是否编译到clas

错误There is no Action mapped for namespace / and action name—Struts2

Struts2出现错误,总是提示"There is no Action mapped for namespace / and action name"的错误. 错误代码如下: 09:36:13,515 WARN [Dispatcher] Could not find action or result There is no Action mapped for namespace [/] and action name [css] associated with context path

HTTP Status 404 - There is no Action mapped for namespace [/] and action name [Action!Method]错误解决

按照书本上的Struts2的例子,运行会出现错误: HTTP Status 404 - There is no Action mapped for namespace [/] and action name [sayHelloAction!sayStruts2] ... 貌似在struts.xml中配置action的method不会出错,而直接在jsp中写“Action!Method.action”就会报错. 搜索许久没有发现解决办法,后来发现第二种写法叫做“DMI”,会产生安全隐患,在stru

struts2 : There is no Action mapped for namespace / and action name

2015.07.13 晚 学习搭建SSI 框架,用到struts2 ,启动后访问指定login.action报错 There is no Action mapped for namespace / and action name 查找原因,struts.xml 没有被找到. 解决方法 1 : 在web.xml中指定struts.xml 的位置 解决方法 2 : 将struts.xml 放在src根目录下,web.xml中不需配置struts.xml的地址. 总结 ,对框架各配置文件之间作用不了解

解决 struts2 报"There is no Action mapped for namespace / and action name"的问题

在配置struts2 入门demo时碰到"There is no Action mapped for namespace / and action name"问题,查了一些资料,但没有完全解决问题, 因为造成此问题的原因有很多, 比如这位博主的文章提到的https://www.cnblogs.com/GeekRegister/articles/4949441.html 我再补充几点调试过程中发现的坑: "There is no Action mapped for namesp

Struts2注解错误之There is no Action mapped for namespace /

我用最新版本的Struts2.3.4做注解操作的时候,一直出现这个问题.花了近两个小时才解决,错误原因让人啼笑皆非-- [plain] view plaincopy There is no Action mapped for namespace [/] and action name [test] associated with context path [/test]. - [unknown location] at com.opensymphony.xwork2.DefaultActionP

使用Struts2遇到There is no action mapped for namespaces / and action name的问题

在最初配置struts中会遇到There is no Action mapped for namespace / and action name类似的问题,很多情况是我们粗心大意导致的,以下为总结的解决方法: 1.struts.xml文件配置错误,这是其中一个很大的原因 DTD的问题在此不再赘述,网上相关的帖子很多,在这里出现的问题主要是适用版本2.0的问题,注意区分2.0和2.1,建议都用2.0 其次就是编码格式的问题,如果遇到中文乱码,记得加 <span style="font-siz

Struts2中There is no Action mapped for namespace错误解决方法

1.我的原有配置 jsp表单提交路径 <form class="layui-form" id="form" action="${ctx }/membersLogin/membersLoginAction!membersLogin.action"> ............ </form> struts2拦截配置 <package name="default" extends="strut