Redirects the client's browser to the given location.
(final String location)
| 459 | |
| 460 | /** Redirects the client's browser to the given location. */ |
| 461 | public void redirect(final String location) { |
| 462 | // set the header AND a meta refresh just in case |
| 463 | response().headers().set("Location", location); |
| 464 | sendReply(HttpResponseStatus.OK, |
| 465 | new StringBuilder( |
| 466 | "<html></head><meta http-equiv=\"refresh\" content=\"0; url=" |
| 467 | + location + "\"></head></html>") |
| 468 | .toString().getBytes(this.getCharset()) |
| 469 | ); |
| 470 | } |
| 471 | |
| 472 | /** |
| 473 | * Escapes a string appropriately to be a valid in JSON. |