<option value="${titleinfo.shopname}"
<c:if test="${titleinfo.shopname eq shop.shopname}"> selected = "selected"</c:if>
>${shop.shopname}</option> //下拉框加判断才会对应起来
@RequestMapping(value = { "/Update"}, method = RequestMethod.GET)
public String updatePage(Model model, ServletRequest request) {
List<BtyShop> list = btyShopService.ListAll();
request.setAttribute("list", list);
List<Region> reg = regionService.ListAll();
request.setAttribute("reg", reg); //请求过程中调用Service方法返回reg对象,将"reg"传回前台,前台使用items="${reg}"接收 var="shop" 并设置使用对象为shop
String title = request.getParameter("title");
Info titleinfo = infoService.selectBytitle(title);
request.setAttribute("titleinfo", titleinfo);
return "app/Info/Update";
}
}
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> // 导入标签库
上传时间:<fmt:formatDate value='${info.time}' type='date' pattern='yyyy-MM-dd HH:mm:ss'/> //jsp页面格式化时间