There is no Action mapped for action name mylogin!regist错误原因
2014-09-29 00:31
651 查看
声明:本博客为原创博客,未经允许,不得转载!小伙伴们如果是在别的地方看到的话,建议还是来csdn上看吧(原文链接地址为http://blog.csdn.net/bettarwang/article/details/39650937),毕竟在csdn上看代码和提问、讨论都更方便。
大家都知道,可以利用DMI(Dynamic Method Invocation,动态方法调用)进行一个Action对应多个表单动作,今晚尝试了登录与注册两个表单动作的示例时,却总是弹出"There is no Action mapped for action name mylogin!regist"的错误,check了好多遍,struts.xml及JSP文件都没有错,src也能编译通过,但是点击注册时却总是弹出上面的错误。
折腾了半个多小时,终于找到原因,原来是没有打开配置项中的动态方法调用,因为Struts2默认是不允许动态方法调用的。找到了原因就好办了,有两种解决方法:
第一种是在struts.xml中加上下面这句:
<constant name="struts.enable.DynamicMethodInvocation" value="true"/>
第二种是在src下面新建一个properties文件,加上struts.enable.DynamicMethodInvocation = true这句。
个人推荐使用第一种方法,原因是第二种方法其实是为了保证向下兼容才保留的,但是新的配置方法是使用xml文件进行配置。
大家都知道,可以利用DMI(Dynamic Method Invocation,动态方法调用)进行一个Action对应多个表单动作,今晚尝试了登录与注册两个表单动作的示例时,却总是弹出"There is no Action mapped for action name mylogin!regist"的错误,check了好多遍,struts.xml及JSP文件都没有错,src也能编译通过,但是点击注册时却总是弹出上面的错误。
折腾了半个多小时,终于找到原因,原来是没有打开配置项中的动态方法调用,因为Struts2默认是不允许动态方法调用的。找到了原因就好办了,有两种解决方法:
第一种是在struts.xml中加上下面这句:
<constant name="struts.enable.DynamicMethodInvocation" value="true"/>
第二种是在src下面新建一个properties文件,加上struts.enable.DynamicMethodInvocation = true这句。
个人推荐使用第一种方法,原因是第二种方法其实是为了保证向下兼容才保留的,但是新的配置方法是使用xml文件进行配置。
相关文章推荐
- ssh web项目出现错误There is no Action mapped for namespace [/] and action name [login] associate解决办法
- There is no Action mapped for namespace [/] and action name [xxxxx] associated with context的错误原因
- 关于struts2框架中的“There is no Action mapped for namespace /a and action name toform.”这个错误的原因
- 关于struts2总是报There is no Action mapped for namespace / and action name login错误的一点经验
- Struts应用出现的错误及解决方法:There is no Action mapped for namespace / and action name login
- 彻底解决STRUTS2 错误There is no Action mapped for namespace / and action name login
- There is no Action mapped for namespace [/] and action name [Login] associated wi
- There is no Action mapped for namespace / and action name错误
- There is no Action mapped for namespace [/] and action name 原因分析
- Struts错误:There is no Action mapped for namespace / and action name
- struts2中的错误:There is no Action mapped for action name . - [unknown location]
- 纯注解方式"There is no Action mapped for namespace [/] and action name [Test] associated with conte"原因
- There is no Action mapped for namespace [/] and action name [login] associat...问题的另一个思路
- Struts2中DMI(动态方法调用)的错误问题(There is no Action mapped for namespace [/xxx] and action name [xxx!yyy] a)
- There is no Action mapped for namespace [/] and action name [login] associated with context path [/M
- HTTP Status 404 - There is no Action mapped for namespace /jsp and action name login. type Status re
- There is no Action mapped for namespace [/] and action name [Login] associated with context path [/e
- There is no Action mapped for namespace [/] and action name [login] associate解决办法 .
- eclipse中配置struts2出现There is no Action mapped for namespace [/] and action name [Login] associated wi
- 每当使用struts2动态方法调用时,总是出现错误:There is no Action mapped for namespace [/user] and action name [user!add]