X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Fpages%2Ferror%2FPageNotFound.java;h=ffc107f598e67ed7bca65bb7fb26e67219a2e581;hb=cc10b8bdcbe80e515cd3b8a3de893a5146ff8790;hp=72057a6678859ff44be8e552d0bf5a8717c96d9e;hpb=3814ddf510756ccc147782009972956f84a8ad7b;p=gigi.git diff --git a/src/org/cacert/gigi/pages/error/PageNotFound.java b/src/org/cacert/gigi/pages/error/PageNotFound.java index 72057a66..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,15 +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; + } }