"400 Bad Request" error solution appears in SpringMVC

When using automatic packaging SpringMVC reception data transfer, if the content-type used is the foreground application / json, you need to use the background

@ResponseBody

(Ajax pass over the processing data into the bean json)

But sometimes added @ResponseBody or error code 400
This may be because the type conversion issues, SpringMVC jsno to convert the String Bean when only type conversion success, so when the property is not String Bean there, but he also jsno this is not a sealed type String attribute data. SpringMVC conversion is unsuccessful because it will refuse access, it will report 400.

So when dealing with the String type can not be converted to a String, and then convert the String type what you want

Guess you like

Origin blog.csdn.net/taoism_jerry/article/details/78431955