Struts2 There is no Action mapped for namespace error resolution

Source: Internet
Author: User

1. My original Configuration

JSP form submission Path

class= "Layui-form" id= "form" action= "${ctx}/memberslogin/membersloginaction!memberslogin.action" >     ............ </form>

STRUTS2 interception Configuration

    <Packageextends= "Struts-default" namespace= "/memberslogin" strict-method-invocation= "false" >        class= "Seventykg.web.MembersLoginAction" >            <result name= "Login_success" >/ index.jsp</result>            <result name= "Login_fail" >/login_fail.jsp</result>        </action>    </Package >

2. As a matter of common sense, no problem.

However, each time you submit a form, the error is as follows:

There is no Action mapped for namespace ...

3. Baidu search a variety of solutions, are not what I want, but I looked at the Struts.xml configuration file, found that there is a place called:

    <!--whether to turn on dynamic method calls--    <constant name= "Struts.enable.DynamicMethodInvocation" value= "true"/>

When this value= "false", it is not supported (${ctx}/memberslogin/membersloginaction!memberslogin.action) with the method ( Memberslogin ), only support (${ctx}/memberslogin/membersloginaction) Such, method words need to write to the configuration file

<Packageextends= "Struts-default" namespace= "/memberslogin" strict-method-invocation= "false" >        class= "Membersloginaction" method= "Memberslogin" >            <result name= "Login_success" >/ index.jsp</result>            <result name= "Login_fail" >/login_fail.jsp</result>        </action> </Package >

Resolve the issue by changing to True

QQ Exchange Group 4060038

Struts2 There is no Action mapped for namespace error resolution

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.