The background object of thymeleaf is null, which solves the problem of error when the object is empty to get the property value

The sale object passed from the background is sale = null


You will be prompted that warrantyperiod cannot be found. Change it to the following:


If the object is empty, the output is empty; if the object exists, the output property value.

Read More: