使用springmvc時報錯
org.springframework.beans.NullValueInNestedPathException: Invalid property 'department' of bean class [com.atguigu.springmvc.crud.entities.Employee]:Could not instantiate property type [com.atguigu.springmvc.crud.entities.Department] to auto-grow nested property path: java.lang.InstantiationException: com.atguigu.springmvc.crud.entities.Departmentorg.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:565)
這是因為類xxx中沒有無參構造方法。因為這個原因它還會報錯
org.springframework.beans.NullValueInNestedPathException: Invalid property 'department' of bean class [com.atguigu.springmvc.crud.entities.Employee]: