try {
URL absoluteUrl = new URL(baseUrl, uriString);
final URI uri = absoluteUrl.toURI();
ResponseBuilder responseBuilder = Response.status(Response.Status.SEE_OTHER);
responseBuilder = responseBuilder.entity(htmlBody);
responseBuilder = responseBuilder.location(uri);
return responseBuilder.build();
} catch (URISyntaxException ex) {
throw new RuntimeException(ex);
} catch (MalformedURLException ex) {
throw new RuntimeException(ex);