EL1007E:在null上找不到属性或字段'idClient'

问题描述

这是我的课程

enter image description here

这是我的控制器

@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 (将#修改为@)