Struts2 DMI动态方法调用

参考:

  • Struts 2 Action redirect not working for the below scenario
  • Struts2 action mapping not working after migrating from 2.3.12 to 2.3.20

First, if you want to use this parameter and DMI you should enable it.

<constant name="struts.enable.DynamicMethodInvocation" value="true" />

then

<result type="redirect">/customer?method:getCustomersList</result>

Note, use a colon to specify a method name in parameter.

or use equivalent syntax

<result type="redirect">/customer!getCustomersList</result>

你可能感兴趣的:(struts)