SpringMVC ajax background cannot get object properties
SpringMVC ajax background cannot get object properties
recently encountered a problem, the record is as follows,
the situation with blog.csdn.net/loveme888/article/details/500.. is similar. I also encountered a problem when the struts2 project was replaced by springMVC. I referred to this blog, but the attributes of the objects in the background debug parameters are still null, so I can’t figure it out. I also encountered a problem when the struts2 project was replaced by springMVC. I referred to this blog, but the attributes of the objects in the background debug parameters are still null, so I can’t figure it out.
The front endpoint is as follows:
According to the tips of this blog, add stringify to the front desk, convert it into a json string, and mark the data type of the passed parameter in ajax
Adding the @responsebody annotation in the background does not help
In a flash, I found that there may be a problem with the value of the struts value stack. Since it is patient.xx, spring does not need to write in this way, it will automatically encapsulate the corresponding xx attribute to the corresponding object, so it is changed to
Sure enough, I got the value in debugging. Although the problem is not big, it is easy to be negligent in modifying the framework, so I record it, and hope that people who encounter similar problems can refer to it~