<div class="col-12 col-sm-6">
<div class="form-group">
<label>识别码(6位数)label>
<p th:text="${msg}">p>
<input type="text" th:value="${msg}" name="admIdentificationCode" id="admIdentificationCode" class="form-control">
div>
div>
controller页面内容:
@RequestMapping("/StudentsInsert")
public Object StudentsInsert(PostsAdm postsAdm,Model model){
int number=postsAdmService.PostsAdmCount();
postsAdm.setAdmId(AdmId.Randomstr(6)+(number+1));
postsAdm.setAdmPassword(DigestUtils.md5Hex(postsAdm.getAdmPassword()));
postsAdm.setAdmIdentificationCode(DigestUtils.md5Hex(postsAdm.getAdmIdentificationCode()));
postsAdm.setAdmSecondaryPassword(DigestUtils.md5Hex(postsAdm.getAdmSecondaryPassword()));
System.out.println(postsAdm);
int num=postsAdmService.PostsAdmInsert(postsAdm);
if (num>0){
model.addAttribute("msg",1);
return "add_student";
}else {
model.addAttribute("msg",0);
return "add_student";
}
}
在前台引入了thymleaf的依赖包吧?后台没有报错吧