Search code examples
javastruts2

Struts Wildcard Mappings not working after upgrading to 2.5.26


I have a action class that uses wild card mappings. it was working in struts 2.5.22, but I tried upgrading to 2.5.26 (and 2.5.25) and now setType is never called.

@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;
  }
...

Solution

  • okay I found the problem. this line is needed in the strutsconfig file, but not in the documentation:

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