Java.lang.NumberFormatException:null
The following error occurred after clicking Save when modifying employee information
Front code: Click Edit to jump to the action named Employee_getemployeebyid, get specific information by ID and then load the information into the modification page
<s:iteratorvar="EMP"Value="#session. EmployeeList"> <tr> <td align="Center"><s:property value="#emp. ID"/></td> <TD align="Center"><s:property value="#emp. UserName"/></td> <TD align="Center"><s:property value="#emp. Sex"/></td> <TD align="Center"><s:property value="#emp. Birthday"/></td> <TD align="Center"><s:property value="#emp. Joinday"/></td> <TD align="Center"><s:property value="#emp. Department.name"/></td> <TD align="Center"><a href="/employee_getemployeebyid?id=<s:property value="#emp. ID"/>">".. /images/edit. PNG"/></a></td> </tr> </s:iterator>
Modify Page:
Click Save to generate the following error:
Navigate to Employeeaction Class 100 row
Integer id = integer.valueof (getId ());
The discovery is not a type conversion error.
After debugging, it is found that the value of GetID () is null by the Set property injection resulting in an ID of NULL
Because the employee entity class already has an id attribute ...
The ID value from the foreground is already in the employee object that was obtained by the model-driven method.
Integer id = employee.getid ();
Problem solving:
Java.lang.NumberFormatException