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

Source: Internet
Author: User

Recently updated struts version found that no matter how the access is not mapped to the specified configuration file, and finally found that the reason for access control. After struts2.3, for access security, the request method interception is increased, which causes error hints that cannot be found when using wildcards to access the mapped object:
There is no action mapped for namespace [/] and Action name [M_hi] associated with context path [].
WORKAROUND: 1 If your referral package Struts2-core is more than 2.3, you need to update the Struts.xml file header:
<! DOCTYPE struts public        "-//apache software foundation//dtd struts Configuration 2.5//en"        "/http Struts.apache.org/dtds/struts-2.5.dtd ">

2 and open method access in Struts.xml:
Mode one: Global configuration

<package name= "Default" extends= "Struts-default" >
<global-allowed-methods>regex:.*</global-allowed-methods>
</package>

Mode two: The action tag within the configuration (multiple methods comma separated)   

<action name= "Login" method= "login" class= "Loginaction" >
<result name= "Login" >/WEB-INF/login.jsp</result>
<allowed-methods>login</allowed-methods>
</action>

 

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.