I need to redirect to a specific external url in my jersey web service
and I am using this method:
public static Response redirectTo(String path) {
URI uri;
try {
uri = new URI(path);
return Response.seeOther(uri).build();
} catch (URISyntaxException e) {
e.printStackTrace();
return null;
}
}
But it navigates to a white screen page and not to stackoverflow.com.
Why is it happening and how to fix it?
This method is called inside this method
@GET
@Path("/login")
@Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response login(@Context UriInfo info, @Context HttpServletRequest request) {
...
String url = "http://stackoverflow.com";
redirectTo(url);
}
the url of login method is called when triggering an event from AppDirect (via browser)