Struts2动态方法调用,找不到Action
2014-06-16 16:08
429 查看
使用Struts2感叹号方式的动态方法调用,struts.xml配置都正常,但是使用http://localhost:8080/XXX/user!list.action访问时,提示:
There is no Action mapped for namespace [/] and action name [user!list] associated with context path [XXX]
原因在于:struts2中默认不允许使用DMI。
此时需要修改struts.xml,添加:<constant name="struts.enable.DynamicMethodInvocation" value="true" /> ,设置这个常量值为true,就可以使用动态方法调用了。
事实上,这种方法是不推荐的,有另外两种动态方法调用的方法:
1.指定method属性
2.通配符方式(官网推荐使用)
There is no Action mapped for namespace [/] and action name [user!list] associated with context path [XXX]
原因在于:struts2中默认不允许使用DMI。
此时需要修改struts.xml,添加:<constant name="struts.enable.DynamicMethodInvocation" value="true" /> ,设置这个常量值为true,就可以使用动态方法调用了。
事实上,这种方法是不推荐的,有另外两种动态方法调用的方法:
1.指定method属性
2.通配符方式(官网推荐使用)
相关文章推荐
- Struts2基础之四:动态方法调用(DMI)和action通配符
- struts2动态方法调用 ActionName!methodName.action
- Struts2中DMI(动态方法调用)的错误问题(There is no Action mapped for namespace [/xxx] and action name [xxx!yyy] a)
- Struts2-02Action动态方法调用
- struts2拦截器的方法过滤功能在Action动态方法调用中的应用 .
- struts2教程:10、动态方法调用和使用通配符定义action
- Struts2自定义Action,自定义方法,DMI(动态方法调用),路径问题
- Struts2关于Action的系统训练4关于动态方法调用DMI
- Struts2的动态调用action方法
- struts2 动态调用action中方法
- struts2学习 - action -3 动态方法调用 DMI
- 复习Struts2之Action动态方法调用
- struts2动态方法调用 ActionName!methodName.action
- struts2_7_Action类中方法的动态调用
- struts2动态方法调用和使用通配符定义action
- struts2:动态方法调用与通配符定义action
- struts2中多个逻辑action(方法)的动态调用
- struts2配置及ActionMethod_DMI_动态方法调用
- 【Struts2学习笔记(6)】Action动态方法调用
- Struts2 ActionMethod DMI(动态方法调用)