What’s the preferred way to handle 404 errors with Play 2.0 and show a nice templated view?
This works in 2.2.1. In Global.java:
public Promise onHandlerNotFound(RequestHeader request) { return Promise.pure(notFound( views.html.throw404.render() )); }
Ensure that you have a view called /views/throw404.scala.html
/views/throw404.scala.html