I have a Jersey Application and I am trying to redirect to a html page which shows the api console when I access "/apiconsole" endpoint as shown below.
/**
* Redirect to API Console
*
* @return API Console
*/
@GET
@Path("/apiconsole")
public Response redirectToApiConsole() {
//redirect path from baseURI to the api console
URI redirectedURL = UriBuilder.fromPath("/api/console/index.html").build();
return Response.seeOther(redirectedURL).build();
}
Is this the same as doing this in Spring?
/**
* Redirect to API Console
*
* @return API Console
*/
@RequestMapping(value = "/apiconsole", method = RequestMethod.GET)
public View redirectToApiConsole() {
return new RedirectView("/api/console/index.html?raml=/api/console/api.raml");
}