跨域问题解决方案
一、解决方案一---- 设置请求头 设置请求头,在请求的资源中设置Access-Control-Allow-Origin请求头 response.setHeader("Access-Control-Allow-Origin", "*"); 1、目录展示 2、A项目导入依赖 3、A项目AServlet package com.a; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @WebServlet("/AServlet") public class AServlet extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,