From e397280b9fc940d9ccb7b478b1cf8bcb6dc3086b Mon Sep 17 00:00:00 2001 From: Simon Redfern Date: Thu, 2 Jul 2015 22:18:19 +0200 Subject: [PATCH] Adding simple 404 page --- src/main/scala/bootstrap/liftweb/Boot.scala | 5 +++ src/main/webapp/404.html | 45 +++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 src/main/webapp/404.html diff --git a/src/main/scala/bootstrap/liftweb/Boot.scala b/src/main/scala/bootstrap/liftweb/Boot.scala index 696cfe6e..d37716c4 100755 --- a/src/main/scala/bootstrap/liftweb/Boot.scala +++ b/src/main/scala/bootstrap/liftweb/Boot.scala @@ -377,5 +377,10 @@ class Boot extends Loggable{ case MyExceptionLogger(_, _, t) => throw t // this will never happen } + + + LiftRules.uriNotFound.prepend(NamedPF("404handler"){ case (req,failure) => + NotFoundAsTemplate(ParsePath(List("404"),"html",true,false)) }) + } } diff --git a/src/main/webapp/404.html b/src/main/webapp/404.html new file mode 100644 index 00000000..fd14ef58 --- /dev/null +++ b/src/main/webapp/404.html @@ -0,0 +1,45 @@ + + + + + + +
+
+

404 Not Found

+
+

+ Sorry, we couldn't find the page you were looking for. +

+ +

+ Maybe this is because you need permission - and you are not logged in? +

+ +
+ + +
+