大家讲道理2017-04-18 09:57:38
Use js to determine whether the value is empty before submitting. If it is empty, assign null
伊谢尔伦2017-04-18 09:57:38
When submitting, wouldn’t it be enough to remove the name of the empty input?
阿神2017-04-18 09:57:38
When you pass the value from the front-end drop-down box to the back-end, if you don't select it, the attribute will be assigned a value of "". You can just judge this on the backend. Normally, the frontend will pass "" for processing
天蓬老师2017-04-18 09:57:38
Why must it be null? The default is ""
if(x!=null && x!equals("")){
//daima
}
怪我咯2017-04-18 09:57:38
It is recommended to use Google’s guava library which has the emptyToNull method under strings