What’s the preferred way to handle 404 errors with Play 2.0 and show a nice templated view?
This works in 2.2.3 Play - Java
public Promise<SimpleResult> onHandlerNotFound(RequestHeader request) {
return Promise<SimpleResult>pure(Results.notFound(views.html.notFound404.render()));
}
html should be within /views/notFound404.scala.html Dont forget to add Results.notFounf() and import play.mvc.Results;