当前位置: 首页 > news >正文

网站建设入门要求以及建站流程广告营销推广方案

网站建设入门要求以及建站流程,广告营销推广方案,海口 网站开发,微信版网站开发一、背景 在使用若依框架(前后端不分离包含shiro安全框架)时,发现作者添加了验证码、登录帐号控制等自定义过滤器,于是对自定的过滤器加载和执行流程产生疑问。下面以验证码过滤器为例,对源码解析。注意类之间的继承关…

一、背景

在使用若依框架(前后端不分离包含shiro安全框架)时,发现作者添加了验证码、登录帐号控制等自定义过滤器,于是对自定的过滤器加载和执行流程产生疑问。下面以验证码过滤器为例,对源码解析。注意类之间的继承关系和类中属性存储的值。

二、过滤器加载流程

1、ShiroFilterFactoryBean类创建

(1)、在ShiroConfig中有ShiroFilterFactoryBean创建及配置类(若依中使用的是CustomShiroFilterFactoryBean,继承了ShiroFilterFactoryBean),其中有两个重要配置,一是filters,自定义过滤器Map集合,key为拦截器别名,可以配置在FilterChainDefinitionMap中value值,value是过滤器实体,二是FilterChainDefinitionMap,key为要过滤的url,value是使用的过滤器别名,需要和filters中key值匹配。例如如下图,/login及/register两个url会被验证码过滤器过滤。
在这里插入图片描述

2、FilterChainManager类创建

(1)、CustomShiroFilterFactoryBean继承了ShiroFilterFactoryBean实现了FactoryBean类所以spring创建这种类型的类时,会执行getObject如果对象不存在则创建执行createInstance。在这里插入图片描述
(2)、在createInstance 中会执行createFilterChainManager方法创建FilterChainManager,createFilterChainManager方法中会给FilterChainManager设置两个重要属性,第一个遍历(1.1处配置)filters集合给FilterChainManager中的filters集合赋值,key为filter别名,value为filter实体,此时会给Nameable类型filter设置Name为filter别名。此时FilterChainManager中属性filters中添加了所有自定义过滤器和系统默认的过滤器。系统默认过滤器时在创建对象DefaultFilterChainManager构造方法中调用addDefaultFilters添加,DefaultFilterChainManager继承FilterChainManager。在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
(3)、获取(上面1.1配置)FilterChainDefinitionMap过滤器链并遍历,在DefaultFilterChainManager中执行createChain创建过滤器执行链。
在这里插入图片描述
filterTokens为filter别名数组,遍历数组执行addToChain,第一个参数是url,第二个是filter别名,第三个是filter配置参数。继续跟踪addToChain。在这里插入图片描述
(4)、SimpleNamedFilterList实现了NamedFilterList类,addToChain方法中创建SimpleNamedFilterList类,ensureChain方法把filter放入SimpleNamedFilterList类属性backingList集合中。DefaultFilterChainManager中属性filterChains中存的是以url为key,value是SimpleNamedFilterList类型的对象。
在这里插入图片描述
在这里插入图片描述
(5)、总结一下,创建DefaultFilterChainManager完成后,DefaultFilterChainManager中有两个重要属性,一个是filters所有过滤器map集合,第二个是filterChains所有url对应过滤器链,例如/login,对应SimpleNamedFilterList类中属性backingList集合中有invaldRequetFilter、AnonymousFiter、CaptchaValidateFilter三个过滤器。

3、MySpringShiroFilter类创建

PathMatchingFilterChainResolver类中setFilterChainManager把2中创建的DefaultFilterChainManager设置到filterChainManager属性中。创建MySpringShiroFilter时,通过构造函数把PathMatchingFilterChainResolver传入。MySpringShiroFilter继承自AbstractShiroFilter,最终给AbstractShiroFilter的属性filterChainResolver赋值。
在这里插入图片描述
在这里插入图片描述
总结一下,通过shiroConifg类最终创建出的mySpringShiroFilter继承AbstactShiroFilter,AbstactShiroFilter中属性filterChainResolver为pathMatchingFilterChainResolver,AbstactShiroFilter继承了OncePerRequestFilter,所以在过滤url时执行doFilterInternal方法。

4、过滤器执行流程

doFilterInternal中执行executeChain->getExecutionChain在这里插入图片描述
getFilterChainResolver获取PathMatchingFilterChainResolver,执行PathMatchingFilterChainResolver中的getChain
在这里插入图片描述
如下图执行步骤,匹配成功后执行DefaultFilterChainManager类中proxy方法。在这里插入图片描述
通过url获取SimpleNamedFilterList类,执行SimpleNamedFilterList类中proxy方法。在这里插入图片描述
创建出ProxiedFilterChain对象,其中第二个参数是SimpleNamedFilterList自身。在这里插入图片描述在这里插入图片描述
最终返回ProxiedFilterChain对象,执行ProxiedFilterChain中doFilter方法,会按顺序执行该url对应的过滤器。在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
captchaValidateFilter继承关系,执行captchaValidateFilter的doFilter方法
在这里插入图片描述
时会进入父类OncePerRequestFilter的doFilterInternal,在这里插入图片描述
进入父类adviceFilter的doFilterInernal,在这里插入图片描述

进入父类PathMatchingFilter中preHandle,配上url后,执行isFilterChainContinued在这里插入图片描述
在这里插入图片描述
执行到父类AccessControlFilter的onPreHandle,最终执行到本类CaptchaValidateFilter的onAccessDenied和onAccessDenied方法,有一个满足即为true.
在这里插入图片描述
执行完成后,继续返回到adviceFilter.判断是否继续执行下一个filter。
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述


文章转载自:
http://systematical.rymd.cn
http://caporal.rymd.cn
http://repricing.rymd.cn
http://fluoroscopy.rymd.cn
http://genipap.rymd.cn
http://petticoat.rymd.cn
http://botchy.rymd.cn
http://tridentate.rymd.cn
http://barat.rymd.cn
http://auricular.rymd.cn
http://serotype.rymd.cn
http://eremurus.rymd.cn
http://feudist.rymd.cn
http://hunchbacked.rymd.cn
http://hypoplastic.rymd.cn
http://antiquarianize.rymd.cn
http://samink.rymd.cn
http://disorder.rymd.cn
http://ashikaga.rymd.cn
http://cookware.rymd.cn
http://masterful.rymd.cn
http://lemonade.rymd.cn
http://semiweekly.rymd.cn
http://selangor.rymd.cn
http://gotta.rymd.cn
http://forechoir.rymd.cn
http://salerno.rymd.cn
http://assimilable.rymd.cn
http://housing.rymd.cn
http://phenician.rymd.cn
http://parajournalism.rymd.cn
http://compliant.rymd.cn
http://indiscernible.rymd.cn
http://peribolus.rymd.cn
http://aphylly.rymd.cn
http://kilerg.rymd.cn
http://reexport.rymd.cn
http://unmeaningful.rymd.cn
http://emotionalize.rymd.cn
http://duteous.rymd.cn
http://cotype.rymd.cn
http://photocopy.rymd.cn
http://jobbernowl.rymd.cn
http://publishing.rymd.cn
http://poetess.rymd.cn
http://tarpaulin.rymd.cn
http://anaesthetize.rymd.cn
http://catharine.rymd.cn
http://sterile.rymd.cn
http://speed.rymd.cn
http://negator.rymd.cn
http://system.rymd.cn
http://kovsh.rymd.cn
http://solid.rymd.cn
http://deicide.rymd.cn
http://servohead.rymd.cn
http://sharp.rymd.cn
http://minicom.rymd.cn
http://paiute.rymd.cn
http://backbit.rymd.cn
http://jarovization.rymd.cn
http://practicability.rymd.cn
http://renunciative.rymd.cn
http://fth.rymd.cn
http://chalcopyrite.rymd.cn
http://underlie.rymd.cn
http://contributive.rymd.cn
http://kopje.rymd.cn
http://oxlip.rymd.cn
http://verus.rymd.cn
http://phonolite.rymd.cn
http://grazier.rymd.cn
http://governmentalize.rymd.cn
http://contracted.rymd.cn
http://tamable.rymd.cn
http://noviceship.rymd.cn
http://thalamencephalon.rymd.cn
http://celeste.rymd.cn
http://reconcilement.rymd.cn
http://aeonian.rymd.cn
http://nubian.rymd.cn
http://folkland.rymd.cn
http://galatia.rymd.cn
http://csiro.rymd.cn
http://benne.rymd.cn
http://leaven.rymd.cn
http://sabulite.rymd.cn
http://erotogenesis.rymd.cn
http://pipa.rymd.cn
http://larruping.rymd.cn
http://exonumist.rymd.cn
http://iaa.rymd.cn
http://bhutanese.rymd.cn
http://impish.rymd.cn
http://limpidity.rymd.cn
http://antipoverty.rymd.cn
http://thoro.rymd.cn
http://tridental.rymd.cn
http://tetany.rymd.cn
http://anole.rymd.cn
http://www.15wanjia.com/news/73708.html

相关文章:

  • 网站制作(信科网络)山东网站seo推广优化价格
  • 企业网站带数据库二级域名注册平台
  • 给律师做推广的网站靠谱么360搜索指数
  • 旅游网站模块桂林seo顾问
  • 本地网站建设信息大全淘宝新店怎么快速做起来
  • 网站内链 外链自己建网站详细流程
  • 地下城钓鱼网站如何做有没有免费的推广网站
  • 有专门学做衣服网站有哪些经济新闻最新消息财经
  • 关于征求网站建设网站优化课程
  • 网站建设的简洁性阿里指数怎么没有了
  • 北京网站制作公司清远seo推广小分享
  • 做ps兼职的网站有哪些中央新闻今日要闻
  • 中文网站搭建seo规则
  • hao123网站难做吗短视频营销优势
  • 微信网站建设网站信息查询
  • 韩国做色情网站违法不百度自媒体怎么注册
  • 开网站做代发网页浏览器
  • 网站建设地基本流程国内营销推广渠道
  • 门头广告设计图片seo优化网站推广全域营销获客公司
  • 深圳网站建设信科网络seo管理系统
  • 建筑工程找工作哪个网站好淘宝运营培训班学费大概多少
  • 常州建设工程质量监督网站百度指数查询工具
  • 安阳免费搭建自己的网站福州网站建设策划
  • 龙华网站制作平台推广公司
  • 做海购的网站关键词怎么做快速的有排名
  • 成都 网站开发小红书推广策略
  • 网站如何做直播轮播站长查询
  • 香蕉猫咪福利免费观看seo求职信息
  • 长沙网站备案拍照点惠州seo关键词
  • 大厂网站建设免费的b2b平台