I've got a jetty server to run my web services. Recently I developed a program to consume the web service and ran into Access-Control-Allow-Origin issue.
How can I add the Access-Control-Allow-Origin: * to a jetty embedded server.
below is the webappcontext code.
public WebAppContext buildWebAppContext(){
webAppContext = new WebAppContext();
webAppContext.setDescriptor(webAppContext + "/WEB-INF/web.xml");
webAppContext.setResourceBase(".");
webAppContext.setContextPath("/posApplication");
webAppContext.setAttribute("webContext", webAppContext);
return webAppContext;
}
Thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…