Ajax Request Call problem

Source: Internet
Author: User


Http://localhost/dev/list and Http://127.0.0.1/dev/list

A recent solution to the general general-purpose system of the architecture, encountering the problem of Ajax requests not being executed, was just beginning to think that the spring security permission settings were there.

Ajax Request Call Problem:

Problem Scenario:

The Http://localhost/dev/listUser interface is called in the Http://127.0.0.1/dev/list page, and,

Use Chrome to show cross-domain, response for preflight is invalid redirect

Problem Analysis:

Everyone knows that the default localhost domain name is the corresponding 127.0.0.1,

You can use the ping command to verify that the response to ping 127.0.0.1 and ping localhost is generally 127.0.0.1

This problem does not exist when you switch the access address to http://localhost/dev/list access, and

That is, the browser or Ajax thinks that 127.0.0.1 and localhost are not in the same domain

So dog blood, do not know the Ajax bug or Count Chrome bug,,,

Problem solving:

Use the same IP or the same domain name

With this in mind, I lost 1 days of youth

Ajax Request Call problem

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.