Domanda

Is this enough to allow other domain to access this resource:

@Override
public Response signIn() {
    //ACAO = Access-Control-Allow-Origin
    Response resp = Response.ok("{ 'login' : 'ok'}").header(ACAO, "*").build();
    return resp;
}
È stato utile?

Soluzione

In this case is better to use an already tested implementation. Adam Bien recently released a library to allow Cross Domain Access for JAX-RS applications. Se the blog post here: CORS FOR JAX-RS 2.0 / JAVA EE 7 RELEASED

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top