如何解决EL1007E:在null上找不到属性或字段'idClient'
这是我的课程
这是我的控制器
@RequestMapping(value="/editClient",method=RequestMethod.GET)
public String editClient( Model model,Long idClient,Depositeur a){
try {
a = clientDao.getByidCleint(idClient);
model.addAttribute("client",a);
} catch (Exception e) {
model.addAttribute("error",e);
return "redirect:/indexClient?idClient="+idClient+"&error="+e.getMessage();
}
return "empl/updateClient";
}
这是我的HTML表单
<form role="form" method="post" th:action="@{Updatep}" th:object="${client}">
<label for="exampleInputEmail1" >Votre ID : </label>
<label for="exampleInputEmail1" th:text="*{idClient}">ID <span class="text-danger">*</span> </label> <br>
<input type="hidden" th:field="*{idClient}" class="form-control" id="exampleInputEmail1"/>
<label for="exampleInputEmail1">Nom <span class="text-danger">*</span> </label>
<input type="text" th:field="*{firstname}" class="form-control" id="exampleInputEmail1"/>
<span class="text-danger" th:errors="${client.firstname}"> </span> <br>
<label for="exampleInputPassword1">Prenom</label>
<input type="text" th:field="*{prenom}" class="form-control" id="exampleInputPassword1" placeholder="Prenom"/>
<span class="text-danger" th:errors="${client.prenom}"> </span> <br>
<label for="exampleInputEmail1">Telephone</label>
<input type="text" th:field="*{telephone}" class="form-control" id="exampleInputEmail1" placeholder="Telephone"/>
<span class="text-danger" th:errors="${client.telephone}"> </span> <br>
<label for="exampleInputEmail1">Adresse</label>
<textarea class="form-control"th:field="*{adresse}" rows="2" cols="4"></textarea>
<span class="text-danger" th:errors="${client.adresse}"> </span> <br>
<div class="col-md-6"><button type="submit" class="btn btn-primary">Mis à jour</button></div>
</form>
当我调用此表单时,得到EL1007E:在null上找不到属性或字段“ idClient”
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。