1 package dolda.jsvc.util;
6 public class Redirect extends RequestRestart {
10 protected Redirect() {
13 public Redirect(URL to) {
18 public Redirect(String to) {
23 public void respond(Request req) {
25 req.outheaders().put("Location", target(req).toString());
28 protected URL target(Request req) {
29 if(this.abs != null) {
33 return(new URL(req.url(), this.rel));
34 } catch(MalformedURLException e) {
35 throw(new RuntimeException("Bad relative URL: + " + this.rel, e));