常用代码:
格式化显示当前日期
if判断
循环列表
服务器:
public String printOrder(Long id, ModelMap mmap) {
String[] fileNames=orderPesticide.getFileName().split(",");
mmap.put("fileNames", fileNames);
return prefix + "/printOrder";
}
页面:
数据包文件名:
服务器:
publicString orderDetail(Long id, ModelMap mmap) {
List details = orderPesticideDetailService.selectOrderPesticideDetailList(orderPesticideDetail);
mmap.put("details", details);return prefix + "/orderDetail";
}
页面:
1.${@dict.hello().fatherName} 显示对象的属性
2.${@dict.hello()[0].fatherName} 显示列表对象的属性
3.
服务器:
publicString customerContact(String customerid, Model model) {
model.addAttribute("customerid", customerid);return prefix + "/customerContact";
}
页面:
th:value="${customerid}"是输出到value
th:text="${customerid}"是输出到text,如:
text
-------------------------------------------------------------------------------------------------------------------------------------------