if (httpMethodAnnotations.size() == 0) {
if (autoRouting) {
// automatically added a special post for POST
// no params on path
if (paramNames.length() > 0) {
Route r = new Route();
r.method = "POST";
r.path = pathSpec; // no params, no post-fix.
r.action = act;
r.routesFile = "_autopath";
r.routesFileLine = AUTO_ROUTE_LINE;
r.compute();
routes.add(r);
}
// the catch other
Route r = new Route();
r.method = "*";
r.path = pathSpec + paramNames + pathEnding;
r.action = act;
r.routesFile = "_autopath";
r.routesFileLine = AUTO_ROUTE_LINE;
r.compute();
routes.add(r);
} else {
Route r = new Route();
r.method = "*";
r.path = pathSpec;
r.action = act;
r.routesFile = "_autopath";
r.routesFileLine = AUTO_ROUTE_LINE;
r.compute();
routes.add(r);
}
} else {
for (Annotation an : httpMethodAnnotations) {
Route r = new Route();
r.method = an.annotationType().getSimpleName();
r.action = act;
r.routesFile = "_autopath";
r.routesFileLine = AUTO_ROUTE_LINE;
if (!autoRouting || an instanceof POST) {
r.path = pathSpec;
} else {
r.path = pathSpec + paramNames + pathEnding;
}
r.compute();
routes.add(r);
}
}
pathSpecPattern = Pattern.compile(pathSpec.replaceAll(RouterClass.urlParamCapture, "\\\\{(.*)\\\\}"));