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.
You will need to perform the following steps before you begin creating custom error pages:
Create a new project.
Create a file called
404.html
by duplicating theindex.html
file.Replace the content of the
div
tag withmain
as the value ofid
with the following code:<h2>Error: 404</h2> <p>Page not found!</p>
Create a new file called
403.html
by duplicating the404.html
file.Replace the content of
div
withmain
as the value ofid
with the following code:<h2>Error: 403</h2> ...