使用临时重定向时如何停止浏览器中的URL更改

时间:2018-08-22 06:54:53

标签: jax-rs url-redirection

在内部重定向到新网站时,如何停止URL更改。

@POST
@Path("/redirectcall")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.TEXT_PLAIN)
public Response makerdCall(@FormDataParam("msg") String msg, @FormDataParam("obj") String obj) throws Exception {
    return Response.temporaryRedirect(new URI("https://abcexample.com"))
            .header("Access-Control-Allow-Origin", "https://xyzexample.com")
            .header("Access-Control-Allow-Methods", "POST, GET, PUT, UPDATE, OPTIONS")
            .header("Access-Control-Allow-Headers", "Content-Type, Accept, X-Requested-With")
            .header("Access-Control-Allow-Credentials", "true")
            .header("Location","/hello")
            .build();

0 个答案:

没有答案