Java.lang.NumberFormatException

Source: Internet
Author: User

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> &LT;TD align="Center"><s:property value="#emp. UserName"/></td> &LT;TD align="Center"><s:property value="#emp. Sex"/></td> &LT;TD align="Center"><s:property value="#emp. Birthday"/></td> &LT;TD align="Center"><s:property value="#emp. Joinday"/></td> &LT;TD align="Center"><s:property value="#emp. Department.name"/></td> &LT;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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.