Reply To: [Bug] IncludeViewParams in command action are not handled.

Splash Forums Rewrite Users [Bug] IncludeViewParams in command action are not handled. Reply To: [Bug] IncludeViewParams in command action are not handled.

#25504

Rewrite basically tries to find a rule that is matching against the outbound URL. The first Join that matches wins. It is AFAIK not possible to implement something like “the best match” wins. And I doubt that this be easy and/or useful.

Lincolns idea was to use an additional query parameter that you would have to add to the outcome to control which Join wins. See these rules as an example:

.addRule(Join.path(“/foo”).to(“/faces/something.xhtml))
.withId("foo")

.addRule(Join.path(“/bar”).to(“/faces/something.xhtml”))
.withId("bar")

No you could choose which rule should apply for the outbound rewriting by returning something like this:

public String navigate() {
  return "/faces/something.xhtml?faces-redirect=true&org.ocpsoft.rewrite.join.id=bar";
}

Joins would check for this query parameter. If it exists, they would match only if the outbound URL matches AND if the Join’s id matches the id from the query parameter.