try {
SubmissionResult res = submit(req);
req.setAttribute(SUBMIT_RESULT, res);
- if (res instanceof RedirectResult) {
- resp.sendRedirect(((RedirectResult) res).target);
- return true;
- }
if (res.endsForm()) {
HttpSession hs = req.getSession();
hs.removeAttribute("form/" + getClass().getName() + "/" + csrf);
}
+ if (res instanceof RedirectResult) {
+ resp.sendRedirect(((RedirectResult) res).target);
+ return true;
+ }
return false;
} catch (PermamentFormException e) {
req.setAttribute(SUBMIT_RESULT, e);
+ req.getSession().removeAttribute("form/" + getClass().getName() + "/" + csrf);
return false;
} catch (GigiApiException e) {
req.setAttribute(SUBMIT_RESULT, e);
public static boolean printFormErrors(HttpServletRequest req, PrintWriter out) {
Object o = req.getAttribute(SUBMIT_RESULT);
if (o != null && (o instanceof PermamentFormException)) {
- ((PermamentFormException) o).getCause().format(out, Page.getLanguage(req));
+ ((PermamentFormException) o).getCause().format(out, Page.getLanguage(req), Page.getDefaultVars(req));
return false;
}
if (o != null && (o instanceof GigiApiException)) {
- ((GigiApiException) o).format(out, Page.getLanguage(req));
+ ((GigiApiException) o).format(out, Page.getLanguage(req), Page.getDefaultVars(req));
return true;
}
if (o != null && (o instanceof FormContinue)) {