Pit with front-end interlock (ii)

Source: Internet
Author: User
Tags browser cache

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.