/** * Add a route to the router. * e.g., add(GET, "/foo/show", FooController.class, "show", [name...]); * The name list is from /foo/show/:name/... */ synchronized Dest add(WebApp.HTTP httpMethod, String path, Class<? extends Controller> cls, String action, List<String> names) { LOG.debug("adding {}({})->{}#{}", new Object[]{path, names, cls, action}); Dest dest = addController(httpMethod, path, cls, action, names); addDefaultView(dest); return dest; }
/** * Add a route to the router. * e.g., add(GET, "/foo/show", FooController.class, "show", [name...]); * The name list is from /foo/show/:name/... */ synchronized Dest add(WebApp.HTTP httpMethod, String path, Class<? extends Controller> cls, String action, List<String> names) { LOG.debug("adding {}({})->{}#{}", new Object[]{path, names, cls, action}); Dest dest = addController(httpMethod, path, cls, action, names); addDefaultView(dest); return dest; }
/** * Add a route to the router. * e.g., add(GET, "/foo/show", FooController.class, "show", [name...]); * The name list is from /foo/show/:name/... */ synchronized Dest addWithOptionalDefaultView(WebApp.HTTP httpMethod, String path, Class<? extends Controller> cls, String action, List<String> names, boolean defaultViewNeeded) { LOG.debug("adding {}({})->{}#{}", new Object[]{path, names, cls, action}); Dest dest = addController(httpMethod, path, cls, action, names); if (defaultViewNeeded) { addDefaultView(dest); } return dest; }