O'Reilly logo

Lift Application Development Cookbook by Gilberto T. Garcia Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating custom error pages

Even if we do test the applications we build, there are aspects and situations that we can't control—the user may type the wrong URL, we could have a problem with the network, or something that we didn't predict may happen and cause the application to fail.

That is why it is important to have a way to create pages to inform the user that something went wrong. Fortunately, Lift allows you to configure error pages based on HTTP response status codes.

Getting ready

You will need to perform the following steps before you begin creating custom error pages:

  1. Create a new project.
  2. Create a file called 404.html by duplicating the index.html file.
  3. Replace the content of the div tag with main as the value of id with the following code: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required