Re: defined rule doesn't work in new version rewrite.

Splash Forums Rewrite Users defined rule doesn't work in new version rewrite. Re: defined rule doesn't work in new version rewrite.

#22469

If I remember correctly Lincoln said that Path doesn’t support regular expressions any more. We modified this because 90% of all problem with rewrite rules in PrettyFaces 3.x occurred due to invalid regular expressions. Building them can get very complex and error prone. Especially because you have to escape certain characters (like .).

Therefore Path now only allows constant strings. BUT if you have a variable part in your URL you can use a parameter and define a constraint for this one using where(..).matches().

Your first rule for example should work like this:

.addRule(
Join.path("/manager/category/{categoryClass.categoryType}.xhtml")
.where("categoryClass.categoryType").matches("(menu|product|article)")
.to("/manager/manager/category/category_list.xhtml")
)

As you see in this example your rule even gets much cleaner because you don’t have to repeat the URL in Join.path() and when().

I hope this works for you. :)

Christian