zoukankan      html  css  js  c++  java
  • 过滤器

    filter用于方法、类,甚至是全局,可以方便的实现权限管理、日志功能。见:

    1、http://www.cnblogs.com/outtamyhead/archive/2013/03/08/2950047.html

    2、http://www.cnblogs.com/AndersLiu/archive/2008/08/26/logging-with-aspnet-mvc-fction-filters.html

    3、http://www.cnblogs.com/Michael-Ben/p/Michael.html

    4、笔者发现在MVC4.0后,微软加了一个AllowAnoumous的过滤器验证,即允许匿名用户访问,方法上的过滤器可以覆盖掉控制器上的标记。这样做有一个好处,因为很多地方都是需要登录后才可以访问的,但是像登录页面,注册页面这些又不需要登录。但是往往都会放在Account控制器中,这样可以方便验证。http://www.cnblogs.com/xdotnet/archive/2012/03/27/aspnet_mvc4_authorize.html

    5、根据时间点分类:

    Authorization --> Action --> Result , Exception

    IAuthorizationFilter:在所有的Filter中最早执行的,可用于Action的权限控制

    IActionFilter:在Action执行的前后,可用于请求跳转、记录Action执行日志

    IResultFilter:在Result执行的前后,可用于记录Result执行日志

    IExceptionFilter:在任何异常发生时,可用于记录日志、处理异常、指定错误页面

    http://www.cnblogs.com/xxinwen/archive/2013/03/05/2944333.html

    http://blog.csdn.net/woods240/article/details/8492542

  • 相关阅读:
    Getting started with the Web ADF
    将搜狗浏览器设置为IIS的默认浏览器
    What is installed with the Web ADF?
    如何修改Flex的默认浏览器
    What is the Web Application Developer Framework
    windows C++获得本地IP地址
    lua table函数库
    【铸铁】C++服务器面试题.doc
    VC2008下提示找不到MSVCP90D.dll的解决办法
    排序
  • 原文地址:https://www.cnblogs.com/tider1999/p/4055649.html
Copyright © 2011-2022 走看看