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