Here's a simple code example that actually does the redirect using a WebApplicationException. So you could put this in your view, or in your resource, and just throw it whenever.
URI uri2 = UriBuilder.fromUri(url).build();
Response response = Response.seeOther(uri2).build();
throw new WebApplicationException(response);
You can also just make your resource return either a view, or a redirect response:
@GET
public Object getView(@Context HttpServletRequest req)
{
if (somethingBad())
{
URI uri = UriBuilder.fromUri("/somewhere_else").build();
return Response.seeOther(uri).build();
}
return new View();
}