There is no Action mapped for namespace [/] and action name [m_hi] associated with context path [](代

业无高卑志当坚,男儿有求安得闲?这篇文章主要讲述There is no Action mapped for namespace [/] and action name [m_hi] associated with context path [](代相关的知识,希望能为你提供帮助。
最近更新struts版本发现,无论怎么访问就是无法映射到指定的配置文件,最后发现原来是访问控制的原因. struts2.3之后为了访问安全,增加了请求方法拦截,这样会造成使用通配符访问时无法找到映射对象的错误提示:

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

  解决方式:     1 如果你的引用包struts2-core是2.3以上版本需要更新struts.xml的文件头:     
< !DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN" "http://struts.apache.org/dtds/struts-2.5.dtd">

【There is no Action mapped for namespace [/] and action name [m_hi] associated with context path [](代】    2 并在struts.xml中开放方法访问:
方式一:全局配置
< package name="default" extends="struts-default">
< global-allowed-methods> regex:.*< /global-allowed-methods>
< /package>
        方式二:action标签内配置(多个方法逗号隔开)    < action name="login" method="login" class="loginAction">
< result name="login"> /WEB-INF/login.jsp< /result>
< allowed-methods> login< /allowed-methods>
< /action>
 
 






    推荐阅读