Reply To: Create One Rule For All Supported Extensions

Splash Forums Rewrite Users Create One Rule For All Supported Extensions Reply To: Create One Rule For All Supported Extensions

#27460

You could simple create loop in your provider that adds these three rules.

ConfigurationBuilder builder = ConfigurationBuilder.begin()
for( String extension : Arrays.asList( "xhtml", "jsf", "jsp" ) {
  builder.addRule(Join.path("/recommended/id/{id}").to("/Recommended." + extension)
        .withInboundCorrection()).where("id").matches("[0-9]+");
}

That’s the nice thing about programmatic configuration. πŸ˜‰