快速开发框架的跨域问题

SDF的跨域问题

ErrorToNotFoundDispatcherServlet,修正为:

    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String method = req.getMethod();
        //if (method.equals(METHOD_GET) || method.equals(METHOD_POST)|| method.equals("OPTIONS")) {
            //System.out.println(1);
            resp.setHeader("Access-Control-Allow-Origin","*");
            resp.setHeader("Access-Control-Allow-Headers", "*");
            resp.setHeader("Access-Control-Allow-Credentials", "true");
            resp.setHeader("aut","code bad");
            super.service(req, resp);
//        } else {
//            //System.out.println(2);
//            resp.setHeader("Access-Control-Allow-Origin","*");
//            resp.setHeader("aut","code bad");
//            String errMsg = lStrings.getString("http.method_not_implemented");
//            resp.sendError(HttpServletResponse.SC_NOT_IMPLEMENTED, MessageFormat.format(errMsg, method));
//        }
    }
posted @ 2022-05-21 11:36  陆敏技  阅读(23)  评论(0编辑  收藏  举报
Web Counter
Coupon for Contacts