adds request attribute users in commit() error path

Tue, 19 May 2020 16:57:29 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 19 May 2020 16:57:29 +0200
changeset 68
ded1b5639bd3
parent 67
d15779cf3982
child 69
2223bd79e0c6

adds request attribute users in commit() error path

src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java file | annotate | diff | comparison | revisions
--- a/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java	Tue May 19 16:55:58 2020 +0200
+++ b/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java	Tue May 19 16:57:29 2020 +0200
@@ -106,7 +106,7 @@
     }
 
     @RequestMapping(requestPath = "commit", method = HttpMethod.POST)
-    public ResponseType commit(HttpServletRequest req, DataAccessObjects dao) {
+    public ResponseType commit(HttpServletRequest req, DataAccessObjects dao) throws SQLException {
 
         Project project = new Project(-1);
         try {
@@ -126,6 +126,7 @@
         } catch (NoSuchElementException | NumberFormatException | SQLException ex) {
             // TODO: set request attribute with error text
             req.setAttribute("project", project);
+            req.setAttribute("users", dao.getUserDao().list());
             setDynamicFragment(req, "project-form");
             LOG.warn("Form validation failure: {}", ex.getMessage());
             LOG.debug("Details:", ex);

mercurial