@Override public void start() { route() .path("/hello") .mapTo(BooAction.class, "foo1") .bind(); route() .path("/world") .mapTo(BooAction.class, "foo2") .interceptBy(EchoInterceptor.class) .bind(); interceptor(EchoInterceptor.class, i -> i.setPrefixIn("====> ")); // additional interceptor configuration } }
/** * Defines HTTP method name and action path. * @see #path(String) */ public ActionBuilder path(final String method, final String path) { this.method = method; return path(path); }
/** * Maps an OPTION path. */ public ActionBuilder options(final String path) { return new ActionBuilder().path(path).httpMethod("OPTIONS"); }
/** * Maps a PUT path. */ public ActionBuilder put(final String path) { return new ActionBuilder().path(path).httpMethod("PUT"); } /**
/** * Maps a GET path. */ public ActionBuilder get(final String path) { return new ActionBuilder().path(path).httpMethod("GET"); } /**
/** * Starts with action registration i.e. route binding. */ public ActionBuilder route() { return new ActionBuilder(); }
/** * Maps a DELETE path. */ public ActionBuilder delete(final String path) { return new ActionBuilder().path(path).httpMethod("DELETE"); } /**
/** * Maps a POST path. */ public ActionBuilder post(final String path) { return new ActionBuilder().path(path).httpMethod("POST"); } /**