struts2拦截action多种方法

时间:2021-03-24 00:00:52

按照教程写的,运行的时候显示There is no Action mapped for namespace [/] and action name [login!method1] associated with context path [/MethodInterceptorDemo],后来发现是教程里struts2的版本是默认开启的,但是我用的版本默认是关闭的,所以在struts.xml中添加<constant name="struts.enable.DynamicMethodInvocation" value="true" />即可