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