I. Problems that arise
The project has some problems during the testing phase, and when there is a page to add or delete data after the refresh, the page does not have any response.
View Add or modify the request, the response is 200 status, prompted to add or remove the success, but the page after the refresh no matter the number or the detail data have not changed, there is not much, the less is also a lot.
And when you see a new or deleted query request, the return status code is 304, which means the page is redirected.
Because this module is related to the front-end code is not now responsible for this, so he is also a good find.
second, the failure of the solution
At the beginning of the online query, said the browser cache problem, so he referenced some of the data modified the request header, plus the following code:
<meta http-equiv= "Pragma" content= "No-cache" >
<meta http-equiv= "Cache-control" content= "No-cache" >
<meta http-equiv= "Expires" content= "0" >
But it is frustrating that this approach does not actually solve our problem, and the result is unchanged when we re-perform the above operation.
third, the successful solution
As a result, he had to work with another colleague on the internet again to find, see the internet said GET request may occur this problem, and then a check, found that our new and deleted query request is really get, so the get to post, I also changed the backend related code to post.
But the result is, anyway I can not receive their data, the console is obviously a 2, my background debug see is still 0.
Never encountered such a problem before, I am also a silent, online search a lot of information without fruit, had to ask old colleagues for help, so the success of the solution, only because my background get into post, with the object to accept parameters when not joined @requestbody this annotation, So spring cannot correctly convert the data passed by the POST request to an object, causing the console to see a request parameter that is different from what I debug see.
@requestbody Annotation Interpretation Reference: http://blog.csdn.net/kobejayandy/article/details/12690555
Pit with front-end interlock (ii)