我正在使用 Springboot、Java 和 Thymeleaf。
public class DirectBind {
@Column(columnDefinition = "date")
@DateTimeFormat(pattern = "MM/dd/yyyy")
private LocalDate policyTermDateStart;
@Column(columnDefinition = "date")
@DateTimeFormat(pattern = "MM/dd/yyyy")
...
}
我的约会对象是 yyyy-mm-dd。您知道我如何更改此代码/在何处实现代码以使其更改。它会进入我的控制器吗?这是我发送获取用户输入日期的表单时的代码
@RequestMapping(value = "/send")
public String send(Model model, @ModelAttribute(value = "directBind") DirectBind directBind) {
List<String> businessAgencyList = directBind.getBusinessAgencyList();
List<String> billTypeOptions = directBind.getBillTypeOptions();
Mail mail = new Mail();
mail.setFrom("no-reply@hgitservices.com");
mail.setTo(new String[]{"stacief@hgitservices.com"});
mail.setSubject("Oli Affiliate - AMS360 & PMA Data Checklist");
Map<String, Object> mailModel = new HashMap<>();
mail.setModel(mailModel);
try {
emailService.sendSimpleMessage(mail, directBind);
} catch (Exception e) {
e.printStackTrace();
return ("redirect:/?sentMessageFail");
}
return ("redirect:/?sentMessage");
}
@RequestMapping(value = "/email")
public String email() {
return "emailMessage";
}
相关分类