public override void Process( ProcessContext context )
        {
            MvcEventPublisher.Instance.BeginCheckForbiddenAction( context.ctx );
            if (context.ctx.utils.isSkipCurrentProcessor()) return;

            MethodInfo actionMethod = context.ctx.ActionMethodInfo; // context.getActionMethod();

            Attribute forbiddenAttr = context.getController().utils.getAttribute( actionMethod, typeof( NonVisitAttribute ) );
            if (forbiddenAttr != null) {
                context.endMsg( lang.get( "exVisitForbidden" ), HttpStatus.Forbidden_403 );
            }
        }
Beispiel #2
0
        public override void Process( ProcessContext context )
        {
            MvcEventPublisher.Instance.BeginCheckHttpMethod( context.ctx );
            if (context.ctx.utils.isSkipCurrentProcessor()) return;

            MethodInfo actionMethod = context.ctx.ActionMethodInfo; // context.getActionMethod();
            String httpMethod = context.ctx.HttpMethod;
            Boolean isMethodError = isHttpMethodError( context.getController().utils.getHttpMethodAttributes( actionMethod ), httpMethod );
            if (isMethodError) {
                context.endMsg( lang.get( "exHttpMethodError" ), HttpStatus.MethodNotAllowed_405 );
            }
        }
        public override void Process( ProcessContext context )
        {
            MvcEventPublisher.Instance.BeginCheckActionMethod( context.ctx );
            if (context.ctx.utils.isSkipCurrentProcessor()) return;

            MvcContext ctx = context.ctx;
            MethodInfo actionMethod = ctx.controller.utils.getMethod( ctx.route.action );

            if (actionMethod == null) {
                context.endMsg( lang.get( "exActionNotFound" ), HttpStatus.NotFound_404 );
            }
            else {
                context.ctx.setActionMethodInfo( actionMethod );
            }
        }
Beispiel #4
0
        public override void Process(ProcessContext context)
        {
            MvcEventPublisher.Instance.BeginCheckHttpMethod(context.ctx);
            if (context.ctx.utils.isSkipCurrentProcessor())
            {
                return;
            }

            MethodInfo actionMethod  = context.ctx.ActionMethodInfo; // context.getActionMethod();
            String     httpMethod    = context.ctx.HttpMethod;
            Boolean    isMethodError = isHttpMethodError(context.getController().utils.getHttpMethodAttributes(actionMethod), httpMethod);

            if (isMethodError)
            {
                context.endMsg(lang.get("exHttpMethodError"), HttpStatus.MethodNotAllowed_405);
            }
        }
Beispiel #5
0
        public override void Process(ProcessContext context)
        {
            MvcEventPublisher.Instance.BeginCheckForbiddenAction(context.ctx);
            if (context.ctx.utils.isSkipCurrentProcessor())
            {
                return;
            }

            MethodInfo actionMethod = context.ctx.ActionMethodInfo; // context.getActionMethod();

            Attribute forbiddenAttr = context.getController().utils.getAttribute(actionMethod, typeof(NonVisitAttribute));

            if (forbiddenAttr != null)
            {
                context.endMsg(lang.get("exVisitForbidden"), HttpStatus.Forbidden_403);
            }
        }
        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 );
            }
        }
Beispiel #7
0
        public override void Process(ProcessContext context)
        {
            MvcEventPublisher.Instance.BeginCheckActionMethod(context.ctx);
            if (context.ctx.utils.isSkipCurrentProcessor())
            {
                return;
            }

            MvcContext ctx          = context.ctx;
            MethodInfo actionMethod = ctx.controller.utils.getMethod(ctx.route.action);

            if (actionMethod == null)
            {
                context.endMsg(lang.get("exActionNotFound"), HttpStatus.NotFound_404);
            }
            else
            {
                context.ctx.setActionMethodInfo(actionMethod);
            }
        }
        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);
            }
        }