[Solved] Field error in object ‘xxx’ on field ‘xxx’: rejected value [xx];

Incorrect translation:

Bad field in object ‘xxx’ on field, value [xxx] rejected.

It means: when writing programs in Springboot or springssm framework or other frameworks, the data passed in from the front end such as

 <input type="text" name="price" class="layui-input"lay-verify="required|number">

The received value type error occurs when the value of this price received from the client does not match the attribute value defined in the backend entity (does not match the type of the value defined by the database).

Solution:

1. See if the basic data types int, double, long, etc. are converted to their corresponding object types Integer, Double, Long, etc.

(ie the attribute type defined in the entity class uses its corresponding object type, Integer)

2. Modify the value of the client and re-enter the value of the correct type.

If an error is still reported, check whether the attribute type in the program is consistent (including database, entity class, front-end page).