Julien Richard-Foy Julien Richard-Foy - 1 month ago 4x
Scala Question

How to create a custom 404 page handler with Play 2.0?

What’s the preferred way to handle 404 errors with Play 2.0 and show a nice templated view?


You can override the onHandlerNotFound method on your Global object, e.g.:

object Global extends GlobalSettings {
  override def onHandlerNotFound(request: RequestHeader): Result = {