Re: Basic Examples

Splash Forums Rewrite Users Basic Examples Re: Basic Examples

#22315

GAH! I see what I did wrong, sorry:

public class UrlRewriteConfig extends HttpConfigurationProvider
{

@Override
public int priority()
{
return 10;
}

@Override
public Configuration getConfiguration(final ServletContext context)
{
return ConfigurationBuilder
.begin()
// hide .jsp extension
.addRule(Join.path("/{file}").to("/{file}.jsp").where("file").matches("[^/.]+").withInboundCorrection()
.when(DispatchType.isRequest()))
// hide /html/ inside path
.addRule(Join.path("/html/{resource}").to("/{resource}").where("resource").matches(".*")
.withInboundCorrection());
}

}

Do you understand why these are changed?

1. Join.path("/{file}").to("/{file}.jsp")

2. .where("file").matches("[^/.]+")

~Lincoln