Julien Richard-Foy Julien Richard-Foy - 1 year ago 59
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?

Answer Source

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

object Global extends GlobalSettings {
  override def onHandlerNotFound(request: RequestHeader): Result = {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download