use of org.webpieces.router.api.dto.MethodMeta in project webpieces by deanhiller.
the class AbstractLoader method createServiceFromFilters.
@Override
public Service<MethodMeta, Action> createServiceFromFilters(RouteMeta meta, List<FilterInfo<?>> filterInfos) {
Injector injector = meta.getInjector();
List<RouteFilter<?>> filters = createFilters(injector, filterInfos);
Service<MethodMeta, Action> svcWithFilters = loader.loadFilters(filters);
return svcWithFilters;
}
use of org.webpieces.router.api.dto.MethodMeta in project webpieces by deanhiller.
the class DevRoutingService method fetchNotFoundRoute.
public NotFoundInfo fetchNotFoundRoute(NotFoundException e, RouterRequest req) {
//Production app's notFound route TBD and used in iframe later
RouteMeta origMeta = routeLoader.fetchNotFoundRoute(req.domain);
if (req.queryParams.containsKey("webpiecesShowPage")) {
//This is actually a callback from the below code's iframe!!!
if (origMeta.getControllerInstance() == null) {
finder.loadControllerIntoMetaObject(origMeta, false);
finder.loadFiltersIntoMeta(origMeta, origMeta.getFilters(), false);
}
Service<MethodMeta, Action> svc = origMeta.getService222();
return new NotFoundInfo(origMeta, svc, req);
}
log.error("(Development only log message) Route not found!!! Either you(developer) typed the wrong url OR you have a bad route. Either way,\n" + " something needs a'fixin. req=" + req, e);
RouteImpl r = new RouteImpl("/org/webpieces/devrouter/impl/NotFoundController.notFound", RouteType.NOT_FOUND);
RouteModuleInfo info = new RouteModuleInfo("", null);
RouteMeta meta = new RouteMeta(r, origMeta.getInjector(), info, config.getUrlEncoding());
if (meta.getControllerInstance() == null) {
finder.loadControllerIntoMetaObject(meta, false);
meta.setService(serviceCreator.create());
}
String reason = "Your route was not found in routes table";
if (e != null)
reason = e.getMessage();
RouterRequest newRequest = new RouterRequest();
newRequest.putMultipart("webpiecesError", "Exception message=" + reason);
newRequest.putMultipart("url", req.relativePath);
return new NotFoundInfo(meta, meta.getService222(), newRequest);
}
Aggregations