2

I have this rewriteconfiguration:

return ConfigurationBuilder.begin()
    .addRule(Join.path("/admin/users").to("/admin/users.xhtml"))
    .addRule(Join.path("/admin/test").to("/admin/test.xhtml"))
    .addRule(Join.path("/admin/foo").to("/admin/foo.xhtml"))
    .addRule(Join.path("/admin/bar").to("/admin/bar.xhtml"))
    .addRule(Join.path("/secure/foo").to("/secure/foo.xhtml"))
    .addRule(Join.path("/secure/bar").to("/secure/bar.xhtml"))
    ;

Is there a way that I can map this one time? I just want the .xhtml part is mapped.

I thought something like this would work, but it didden't:

.addRule(Join.path("/admin/*").to("/admin/*.xhtml"))
Wesley Egbertsen
  • 720
  • 1
  • 8
  • 25

1 Answers1

2

After more research and googling, i've found the solution:

return ConfigurationBuilder.begin()
    .addRule(Join.path("/secure/{page}").to("/secure/{page}.xhtml"))
    .addRule(Join.path("/admin/{page}").to("/admin/{page}.xhtml"))
    ;
Wesley Egbertsen
  • 720
  • 1
  • 8
  • 25