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();
}
精彩评论