Im 봄용 MVC를 사용합니다.여러 경로에서 동일한 경로를 처리하려는 경우 Spring
@RequestMapping(value = "/approval/pendingescort", method = RequestMethod.GET)
public String getPendingEscort(Model model) {
log.debug("Received request to show Pending Escorts");
// Retrieve all pending escort details by delegating the call to Servicelayer
List<EscortRegistration> pendingEscortdetails = approvalService.getAllPendingEscort();
// Attach zones to the Model
model.addAttribute("pendingEscortdetails", pendingEscortdetails);
// This will resolve to /WEB-INF/jsp/pendingescort.jsp
return "pendingescort";
}
@RequestMapping(value = "/approval/pendingescort/success", method = RequestMethod.GET)
public String addEscort(@RequestParam(value="mobileno", required=true) String mobileno,Model model) {
log.debug("Received request to Accept Escort Request");
// Call ZonedetailsService to do the actual Updating
approvalService.approveEscortRequest(mobileno);
// Add mobile reference to Model
model.addAttribute("mobileno", mobileno);
// This will resolve to /WEB-INF/jsp/addedescortpage.jsp
return "pendingescort";
}
내 JSP는 다음과 같습니다 :
내 컨트롤러는
<tbody>
<c:forEach items="${pendingEscortdetails}" var="escort">
<c:url var="editUrl" value="/efmfm/main/approval/pendingescort/success?mobileno=${escort.mobilenumber}" />
<c:url var="deleteUrl" value="/efmfm/main/approval/pendingescort/delete?mobileno=${escort.mobilenumber}" />
<tr>
<td><c:out value="${escort.mobilenumber}" /></td>
<td><c:out value="${escort.imei}" /></td>
<td> <a href="${editUrl}" class="approv">Approve</a>
<!-- <td>Approve</td> -->
<a href="${deleteUrl}" class="approv">Reject</a>
</td>
</tr>
</c:forEach>
</tbody
나는 그것의 성공 페이지로 보내 승인을 클릭
. 이걸 이전 페이지로 새로 고침하고 싶습니다. 누구든지 내 문제를 해결할 수 있습니까?
질문이 이해가 가지 않습니다. – tbsalling
Approve 값을 승인하려고 시도하면 다른 성공 페이지로 리디렉션되지만 이전 페이지로 되돌아 가지 않습니다. –
에스코트와 모바일 번호는 좋은 시간입니다. Mabye는 모델을 정의하고 리디렉션을 봅니다. ModelAndView nextView = 새로운 ModselAndView ("redirect : pendingEscortdetails"); –