异常信息:
Struts has detected an unhandled exception:

Messages:
There is no Action mapped for namespace [/user] and action name [User_login] associated with context path [/StrutsTest].
struts.xml配置如下

<struts>
<constant name="struts.devMode" value="true"></constant>
<package name="default" extends="struts-default"</package>
<package name="user" namespace="/user" extends="default">
<action name="*_*" class="action.{1}Action" method="{2}">
<result name="success">/success.jsp</result>
<result name="false">/false.jsp</result>
<allowed-methods>login</allowed-methods>
</action>
</package>
</struts>

,以前使用通配符使用的好好的,现在却不能用了。搜索后发现在struts2.3版本之后需要在action标签加上这行代码​​<allowed-methods>方法1,方法2…</allowed-methods>​​才能使用通配符

<struts>
<constant name="struts.devMode" value="true"></constant>
<package name="default" extends="struts-default"</package>
<package name="user" namespace="/user" extends="default">
<action name="*_*" class="action.{1}Action" method="{2}">
<result name="success">/success.jsp</result>
<result name="false">/false.jsp</result>
<allowed-methods>login</allowed-methods>
</action>
</package>
</struts>