Struts 升级到 2.5.26 后通配符映射不起作用

Struts Wildcard Mappings not working after upgrading to 2.5.26

我有一个使用通配符映射的操作 class。它在 struts 2.5.22 中工作,但我尝试升级到 2.5.26(和 2.5.25),但现在从未调用过 setType。

@Component
@Namespace("/applications/proxy")
@Flow(purgeAllBefore = "Y")
@Action(value = "{type}")
@Results({@Result(name = "input", type = "dispatcher", location = "/jsp/applications/proxy.jsp"),
          @Result(name = "success", type = "redirectAction", location = "${type}", params = {"namespace", "/applications"}),
          @Result(name = "auto-select", type = "redirectAction", location = "${autoSelectUrl}", params = {"namespace", "/"})})
public class ProxyAction extends SearchSupport {
  // Struts wildcard action mapping variable for the attachment, for example: 'J', 'R', 'I', 'N', 'H'
  private String type;
 
  public String getType() {
    return type;
  }
 
  public void setType(String type) {
    this.type = type;
  }
...

好的,我发现了问题。 strutsconfig 文件中需要这一行,但文档中不需要:

<constant name="struts.matcher.appendNamedParameters" value="true"/>