X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Fpages%2Ferror%2FPageNotFound.java;h=ffc107f598e67ed7bca65bb7fb26e67219a2e581;hb=4051cdcc800038b556c53b3e4373e6e6a9953721;hp=507821caa5559e3df03686e4c0418375f1c1dada;hpb=36cfe60cd5db9f4169d82aaa68ba9417c0af6474;p=gigi.git diff --git a/src/org/cacert/gigi/pages/error/PageNotFound.java b/src/org/cacert/gigi/pages/error/PageNotFound.java index 507821ca..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,18 +10,26 @@ import org.cacert.gigi.pages.Page; public class PageNotFound extends Page { - public PageNotFound(String title) { - super(title); - } - - @Override - public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - getDefaultTemplate().output(resp.getWriter(), Page.getLanguage(req), null); - } - - @Override - public boolean needsLogin() { - return false; - } + public static final String MESSAGE_ATTRIBUTE = "message-Str"; + + 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; + } }