Re: Basic Examples

Splash Forums Rewrite Users Basic Examples Re: Basic Examples

#22324

Well. There’s still some kind of issue with the error page not displaying, but the StackOverflow error was a mistake in the configuration:

.defineRule().when(DispatchType.isError()).perform(Lifecycle.handled())

Full config. Also, you didn’t use relative links in your URLs, that was a problem when deploying with a context-root.

@Override
public Configuration getConfiguration(final ServletContext context) {
return ConfigurationBuilder.begin()
// exclude on error-page
.defineRule().when(DispatchType.isError()).perform(Lifecycle.handled())
// add .jsp extension
.addRule(Join.path("/{file}").to("/{file}.jsp").where("file")
.matches("[^/.]+").withInboundCorrection().when(DispatchType.isRequest()))
// add /html/ inside path
.addRule(Join.path("/{resource}").to("/html/{resource}").where("resource").matches("(?!html).*")
.withInboundCorrection());
}