动态方法调用 :Could not find action or result

错误提示:
Messages: There is no Action mapped for namespace [/] and action name [user!add] associated with context path [/bjsxt_struts2_011]. 

调用URL:
http://localhost:8094/bjsxt_struts2_011/user!add


原因:
由于这是一个学习用的例子。而我的struts.xml又是直接拷贝的
http://struts.apache.org/上面的例子,
不小心把这句话给拷贝上了:
<constant name="struts.enable.DynamicMethodInvocation" value="false" />


struts.enable.DynamicMethodInvocation属性的含义是:
### Set this to false if you wish to disable implicit dynamic method invocation
### via the URL request. This includes URLs like foo!bar.action, as well as params
### like method:bar (but not action:foo).
### An alternative to implicit dynamic method invocation is to use wildcard
### mappings, such as <action name="*/*" method="{2}" class="actions.{1}">
struts.enable.DynamicMethodInvocation = true














-

你可能感兴趣的:(struts2,result,动态方法调用)