All fallbacks added to the login site. Edited voting.html
.gitignore:
- added the /logs folder to the gitignore
VotingController.java:
- added log message logging false entry format
Candidate.java:
- return type changed from 'String' to 'Candidate'
wrongEmail.html:
- added html file to avoid error
voting.html:
- changed the way of output
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -31,3 +31,4 @@ build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
*.log
|
||||
|
||||
@@ -85,6 +85,7 @@ public class VotingController {
|
||||
return "errors/notRegistered.html";
|
||||
}
|
||||
}
|
||||
LOGGER.error("Wrong input format detected: " + name);
|
||||
return "errors/wrongEmail.html";
|
||||
}
|
||||
|
||||
|
||||
@@ -40,5 +40,5 @@ public class Candidate {
|
||||
return votes;
|
||||
}
|
||||
|
||||
public String getCategory() {return category.getName();}
|
||||
public Category getCategory() {return category;}
|
||||
}
|
||||
|
||||
0
src/main/resources/templates/errors/wrongEmail.html
Normal file
0
src/main/resources/templates/errors/wrongEmail.html
Normal file
@@ -10,13 +10,13 @@
|
||||
<body>
|
||||
<h1>Wähle deine Kandidaten:</h1>
|
||||
|
||||
<div th:each="candidate: ${candidates}">
|
||||
<p th:text="${candidate.id}"></p>
|
||||
<p th:text="${candidate.name}"></p>
|
||||
<p th:text="${candidate.votes}"></p>
|
||||
<p th:text="${candidate.category}"></p>
|
||||
<!-- <input type="checkbox" id="${candidate.id}" name="${candidate.name}" unchecked>
|
||||
<label for="${candidate.id}" th:text="${candidate.name}"></label> -->
|
||||
<div th:each="candidate : ${candidates}" class="candidates">
|
||||
<h2 th:text="${candidate.category.name}"></h2>
|
||||
<ul>
|
||||
<li th:text="${candidate.name}"></li>
|
||||
<li th:text="${candidate.votes}"></li>
|
||||
<li th:text="${candidate.category.id}"></li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user