X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Fpages%2Ferror%2FPageNotFound.java;h=ffc107f598e67ed7bca65bb7fb26e67219a2e581;hb=ac2d612bc322ee04e31b611a71765e7ae3f1dcf3;hp=0033f2397c74f5894c1f90539ca93662095cc26c;hpb=2824d1c165c501e2f3a8809044788b33b81f478a;p=gigi.git diff --git a/src/org/cacert/gigi/pages/error/PageNotFound.java b/src/org/cacert/gigi/pages/error/PageNotFound.java index 0033f239..ffc107f5 100644 --- a/src/org/cacert/gigi/pages/error/PageNotFound.java +++ b/src/org/cacert/gigi/pages/error/PageNotFound.java @@ -1,6 +1,7 @@ package org.cacert.gigi.pages.error; import java.io.IOException; +import java.util.HashMap; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -9,13 +10,26 @@ import org.cacert.gigi.pages.Page; public class PageNotFound extends Page { - public PageNotFound(String title) { - super(title); - } + public static final String MESSAGE_ATTRIBUTE = "message-Str"; - @Override - public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - getDefaultTemplate().output(resp.getWriter(), Page.getLanguage(req), null); - } + public PageNotFound() { + super("File not found!"); + } + + @Override + public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { + HashMap vars = new HashMap<>(); + Object customMessage = req.getAttribute(MESSAGE_ATTRIBUTE); + if (customMessage == null) { + customMessage = getLanguage(req).getTranslation("Due to recent site changes bookmarks may no longer be valid, please update your bookmarks."); + } + vars.put("message", customMessage); + getDefaultTemplate().output(resp.getWriter(), Page.getLanguage(req), vars); + } + + @Override + public boolean needsLogin() { + return false; + } }