From 93ab2f30392cf35bdb09d72211156347820e93fe Mon Sep 17 00:00:00 2001 From: joethei Date: Fri, 3 May 2019 09:32:39 +0200 Subject: [PATCH] Aufgabe 3: kleinere fixes --- src/main/webapp/category.jsp | 3 ++- src/main/webapp/index.html | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/category.jsp b/src/main/webapp/category.jsp index 97dbd65..3bbe69a 100644 --- a/src/main/webapp/category.jsp +++ b/src/main/webapp/category.jsp @@ -10,7 +10,7 @@ response.setCharacterEncoding(StandardCharsets.UTF_8.name()); String idValue = request.getParameter("id"); Category category; - Database db = Database.getInstance(); + if (idValue == null) { %>
@@ -21,6 +21,7 @@ <% } else { long id = Long.valueOf(idValue); + Database db = Database.getInstance(); category = db.getCategory(id); if (category != null) { %> diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html index ef273a3..8b1863a 100644 --- a/src/main/webapp/index.html +++ b/src/main/webapp/index.html @@ -7,6 +7,7 @@ \ No newline at end of file