使用通配符* There is no Action mapped for namespace [/] and action name [user_add] associated with conte

来源:互联网 发布:超级玛丽mac版 编辑:程序博客网 时间:2024/05/16 17:33

其中的action name=”user_*”中*这个符号代表的值会传入method=“{1}”中,并对应action类的一个方法名,这样就能很大程度地减少配置文档中action的数目。

但是在使用这种通配符方法的时候,经常会看到这样的映射错误提示、

There is no Action mapped for namespace [/] and action name [user_add] associated with context path [/crm].

最后是在配置文档struts.xml的Action中配置了<allowed-methods>Action内的方法名</allowed-methods>

<package name="crm" extends="struts-default" namespace="/"><action name="*_*" class="*Action" method="{1}"><result name="success_redirect" type="redirect">/jsp/{1}_{2}.jsp</result><result name="success">/jsp/{1}_list.jsp</result><allowed-methods>add</allowed-methods></action></package>


阅读全文
0 0
原创粉丝点击