Skip to content

Commit

Permalink
Added comments to help Michele
Browse files Browse the repository at this point in the history
  • Loading branch information
ms@Nicro authored and ms@Nicro committed Jan 6, 2024
1 parent 8f41ba5 commit 8e8ab9f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/controller/ExerciseController.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class ExerciseController extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
ExerciseManager em = new ExerciseManager();
String id = request.getParameter("exerciseID");
//Aggiungi alla sessione insertion date @michele
ExerciseGlossary ex = em.getExercise(Integer.parseInt(id));
request.getSession().setAttribute("exercise", ex);
response.sendRedirect(request.getContextPath() + "/JSP/exercise.jsp");
Expand Down
1 change: 1 addition & 0 deletions src/main/java/controller/ExerciseLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ private boolean saveInDB(HttpServletRequest request, Blob execution){
int userId = Integer.parseInt((String) session.getAttribute("userId"));
int exerciseId = Integer.parseInt((String) session.getAttribute("exerciseId"));
Date insertDate = Date.valueOf((String) session.getAttribute("insertDate"));
//pulisci la sessione @michele
return em.saveExecution(userId, exerciseId, insertDate, execution);
}
}
2 changes: 1 addition & 1 deletion src/main/webapp/JSP/exercise.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<head>
<%
ExerciseGlossary exercise = (ExerciseGlossary) session.getAttribute("exercise");
session.removeAttribute("exercise");
//session.removeAttribute("exercise"); @michele fallo nella homepage questa cosa, ovviamente controlla se prima esiste poi nel caso elimini
%>

<title>Esercizio <%= exercise.getIdExercise()%></title>
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/JSP/exerciseTest.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<body>
<form action="${pageContext.request.contextPath}/exerciseController" method="post">
<input type="number" name="exerciseID" value="">
<!-- <input type="hidden" name="insertionDate" value=""> @michele -->
<input type="submit">
</form>
</body>
Expand Down

0 comments on commit 8e8ab9f

Please sign in to comment.