REST返回Response.temporaryRedirect - 为CORS请求阻止了重定向

时间:2015-06-16 10:22:15

标签: java rest response

我在REST Java Server方面有以下内容,但我得到了 Redirect was blocked for CORS request

如何解决这个问题?

@POST
    @Path("/details")
    public void findDetails(@FormParam("productName")
        String productName, @Context
        HttpServletRequest request, @Context
        HttpServletResponse response) {
        URI location = new java.net.URI("http://www.google.com");


            if (productName != null) {
                return Response.temporaryRedirect(location).build();                    
            }
        }

1 个答案:

答案 0 :(得分:1)

不应该

Web\Configurations

productName != null

或重命名为

userid != null