Do not judge strictly, the error in some trifles probably. There is view.jsp , a piece of code of interest here:
<h1 class="tab"> View parts of details </h1> <c:if test="${!empty detailList}"> <table class="tab"> <tr> <th width="200">Name</th> <th width="80">Required</th> <th width="60">Count</th> <th width="60">Edit</th> <th width="60">Delete</th> </tr> <c:forEach items="${detailList}" var="detail"> <tr> <td>${detail.name}</td> <td>${detail.required}</td> <td>${detail.count}</td> <td><a href="<c:url value='/edit/${detail.name}/${page}/${detailList.size()}/${nameoflist}'/>">Edit</a></td> <td><a href="<c:url value='/delete/${detail.id}/${page}/${detailList.size()}/${nameoflist}'/>">Delete</a></td> </tr> </c:forEach> </table> </c:if> from the line with the link, and specifically this one:
<td><a href="<c:url value='/edit/${detail.name}/${page}/${detailList.size()}/${nameoflist}'/>">Edit</a></td> Throws in the controller, specifically here:
@GetMapping("/edit/{name}/{page}/{dlist}/{nameoflist}") public String edit(Model model, @PathVariable("name") String name, @PathVariable("page") int page, @PathVariable("dlist") int dlist, @PathVariable("nameoflist") String nameoflist){ Detail detailForEdit = serviceClassDetail.findByName(name); System.out.println(detailForEdit.getName() + detailForEdit.getId() + detailForEdit.getCount()); String str = serviceClassDetail.creatRedirectForEditDelete(dlist, nameoflist, page); model.addAttribute("detailForEdit", detailForEdit); return str; // "redirect:/[nameoflist]?=[page]" } From which redirect back to view. However, when I try to get this variable there, it is not there at all. Where and what am I doing wrong?
I try to view this data in a view simply:
<c:if test="${detailForEdit != null}"> <a> ${detailForEdit.name} </a> </c:if> <a> detailForEdit = ${detailForEdit.name} </a> PS: description of logic: when I click on edit , I know which element I need to change, I switch to the controller-get-mapping, I pull out the data for changes and I want to substitute them into the view for subsequent changes, redirect it there, but there this data through the model does not come, why? Yes, sout in the controller is to verify that the data is really there.