public override void Process(ProcessContext context) { MvcContext ctx = context.ctx; MvcEventPublisher.Instance.BeginParseRoute(ctx); if (ctx.utils.isSkipCurrentProcessor()) { return; } try { Route r = RouteTool.Recognize(ctx); if (r == null) { throw new MvcException(HttpStatus.NotFound_404, "can't find matching route : Url=" + ctx.url.ToString()); } ctx.utils.setRoute(r); IsSiteClosed(ctx); } catch (MvcException ex) { ctx.utils.endMsg(ex.Message, HttpStatus.NotFound_404); } }
private void updateRoute_Menu(MvcContext ctx, List <IMenu> list, String cleanUrlWithoutOwner) { foreach (IMenu menu in list) { if (cleanUrlWithoutOwner.Equals(menu.Url)) // 如果有好网址相同 // 获取实际的网址 { String fullUrl = UrlConverter.getMenuFullPath(ctx, menu); Route.setRoutePath(fullUrl); Route newRoute = RouteTool.Recognize(fullUrl, ctx.web.PathApplication); refreshRouteAndOwner(ctx, newRoute); break; } } }
public override void Process(ProcessContext context) { MvcEventPublisher.Instance.BeginParseRoute(context.ctx); if (context.ctx.utils.isSkipCurrentProcessor()) { return; } try { Route r = RouteTool.Recognize(context.ctx); //logger.Info( string.Format( "owner={0}, ownertype={1}, controller={2}, action={3}", r.owner, r.ownerType, r.controller, r.action ) ); context.ctx.utils.setRoute(r); IsSiteClosed(context.ctx); } catch (MvcException ex) { context.endMsg(ex.Message, HttpStatus.NotFound_404); } }