开发者

Jetty server allow all cross origins

I use jetty as java lib to run my local se开发者_运维知识库rver, that has static content. How can I configure this server to allow all cross origins? This is the code of my server:

        Server server = new Server(8087);

        Context staticContext = new Context(server, "/", 0);
        staticContext.setHandler(new ResourceHandler());
        staticContext.setResourceBase("./static");
        staticContext.setContextPath("/");
        try {
            server.start();
        } catch (Exception e1) {
            e1.printStackTrace();
        }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜