@RequestMapping删除操作(值=“/ RemoveOneSubject”,方法= RequestMethod.POST) 公共的ModelAndView RemoveOneSubject(HttpServletRequest的请求)抛出IOException异常{我需要一个REST URL我需要执行使用REST API我需要客户端代码我的代码是这样
ModelAndView model = new ModelAndView("RemoveOneSubject");
final String uri = "http://localhost:8080/subject/api/remove/{id}";
String id = request.getParameter("id");
RestTemplate restTemplate = new RestTemplate();
restTemplate.delete (uri,id);
model.addObject("theSubject", id);
return model;
enter code herejsp is
删除
<table id="myTable" class="table table-striped">
<thead>
<tr>
<th></th>
<th>Name</th>
<th>Created by</th>
<th>Created time</th>
</td></th>
</tr>
</thead>
<tbody>
<c:if test="${not empty theSubject}">
<c:forEach var="listValue" items="${theSubject}">
<tr>
<td><input type="checkbox" name="chkBox"></td>
<td><a href=""><c:out value="${listValue.name}" /></a></td>
<td><c:out value="${listValue.createdBy}" /></td>
<td><c:out value="${listValue.createTime}" /></td>
<td><c:out value="${listValue.studentID}"></c:out></td> </tr>
</c:forEach>
</c:if>
</tbody>
</table>
请阅读[mcve]并相应地提高您的问题。并提示:预览窗口存在的原因。您希望我们花时间帮助您解决问题,因此您请花时间编写格式良好的人性化问题。 – GhostCat