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

视频网站做app推广赚佣金项目

视频网站做app,推广赚佣金项目,创建网站目录结构应遵循的方法,子域名wordpress伪静态委托模式的体现,在初始化醒目的时候Spring MVC为我们提供了一个DispatcherServlet,映射了所有的路径,所有的请求都会先到达这里然后被转发到具体的Controller 进行处理,此文来探索一下,DispatcherServlet 初始化的时候…

委托模式的体现,在初始化醒目的时候Spring MVC为我们提供了一个DispatcherServlet,映射了所有的路径,所有的请求都会先到达这里然后被转发到具体的Controller 进行处理,此文来探索一下,DispatcherServlet 初始化的时候是怎么和Spring IOC打通的。

DispatcherServlet初始化

初始化只在首次加载的时候进行初始化,也就是说我们的DispatcherServlet是单例的。
HttpServletBean#init()
在这里插入图片描述
在这里插入图片描述
可以看到创建了一个WebApplicationContext,在里面调用了onRefresh方法,那我们看看onRefresh做了什么事情呢?
在这里插入图片描述
我们继续跟进去发现,初始化其实就是IOC容器去获得这个Bean对象,这个时候我产生了一个疑问,这个启动流程是什么时候和IOC容器打通的呢?并且断点到这里的时候Context 是AnnotationConfigServletWebServerApplicationContext,哪里来的,怎么就能获取Bean呢?
在这里插入图片描述
啊啊啊,真是反复调试了好久终于算是理清楚了整个流程,首先我们来看SpringApplication#run方法:
在这里插入图片描述
看到了吧,这里创建Context的时候可大有文章,继续点进去看:
在这里插入图片描述
看到了没有,这里有个ApplicationType,那么这个值又是哪里来的?有那些值?

在这里插入图片描述
好家伙是推断出来的,推断就是根据类名来判断的,那有哪些值呢?嘿嘿看到了吧,有三种值。
在这里插入图片描述
好吧,我知道了这一步是判断成了Servlet类型创建了这个类型的AnnotationConfigServletWebServerApplicationContext,那然后呢?别急让我们继续跟踪一波源码呀,我们直接看下面刷新方法:
在这里插入图片描述
在这里插入图片描述
哇偶最终是调用的Context的刷新方法呢,那我们继续看看呗,我尼玛好家伙这又父类去了:
在这里插入图片描述
那么父类是谁?尽然是AbstractApplicationContext 索达斯内,好家伙熟悉了吧,想必跟踪过Spring源码的同学可太熟悉这个类了,原来如此呀,这不就和Spring IOC打通了嘛。
在这里插入图片描述

我们继续看,刷新之后干了什么?看到了吧创建了WebServer。
在这里插入图片描述
好,没完呢, 到这只是回答了为什么和IOC容器打通了,那么为什么FrameFrameWrork#initWebApplicationContext这方法里面红框里的代码执行了以后就拿到了刚刚创创建的AnnotationConfigServletWebServerApplicationContext呢?
在这里插入图片描述
好我们继续看源码,关键就在这里了是通过ServletContext#getAttribute得到的,且attrName = org.springframework.web.context.WebApplicationContext.ROOT,那么是什么时候设置进去的,那既然有get,那有没有set方法呢?于是找到了setAttribute这个方法:
在这里插入图片描述
那我们找到这个方法在哪里用了?用到的地方太多了,那么直接在接口上打一个断点,并且当属性是org.springframework.web.context.WebApplicationContext.ROOT不就可以找到谁调用了这个方法嘛,机智如我呀。
在这里插入图片描述
哈哈哈哈,终于被我发现了,好家伙,看堆栈是通过prepareWebApplicationContext这个调用过来的:

在这里插入图片描述
ServletWebServerApplicationContext#prepareWebApplicationContext在这里插入图片描述

但是这个方法又是被谁调用了呢?那么我们继续追呗。
在这里插入图片描述
芜湖,getSelfInitializer是在创建Web容器的时候调用的,到这里逻辑闭环了不是,这不就是创建WebServer的时候调用的吗?
在这里插入图片描述
哈哈哈哈,小样拿下。跟踪源码经常晕头转向但是,梳理清楚流程以后还是蛮开心的。好了今天的文章到此结束,能力不足水平有限欢迎批评指正,比心么么。


文章转载自:
http://autocycle.wwxg.cn
http://tatar.wwxg.cn
http://eastward.wwxg.cn
http://anthophagy.wwxg.cn
http://neophiliac.wwxg.cn
http://caseidin.wwxg.cn
http://incurrent.wwxg.cn
http://chess.wwxg.cn
http://lobar.wwxg.cn
http://ringdove.wwxg.cn
http://semite.wwxg.cn
http://surpass.wwxg.cn
http://hepaticoenterostomy.wwxg.cn
http://outsoar.wwxg.cn
http://somatomedin.wwxg.cn
http://remedy.wwxg.cn
http://inconvenience.wwxg.cn
http://unbind.wwxg.cn
http://delightsome.wwxg.cn
http://zapata.wwxg.cn
http://directional.wwxg.cn
http://blackface.wwxg.cn
http://keister.wwxg.cn
http://sweatband.wwxg.cn
http://freehearted.wwxg.cn
http://cordis.wwxg.cn
http://nonprotein.wwxg.cn
http://yore.wwxg.cn
http://excitably.wwxg.cn
http://display.wwxg.cn
http://lxx.wwxg.cn
http://regelate.wwxg.cn
http://postscript.wwxg.cn
http://retinae.wwxg.cn
http://silvicide.wwxg.cn
http://terror.wwxg.cn
http://nonjurant.wwxg.cn
http://linoleum.wwxg.cn
http://corfam.wwxg.cn
http://hallucinant.wwxg.cn
http://divesture.wwxg.cn
http://irvingite.wwxg.cn
http://paced.wwxg.cn
http://turbidimeter.wwxg.cn
http://childie.wwxg.cn
http://achromatism.wwxg.cn
http://azotobacter.wwxg.cn
http://telecommand.wwxg.cn
http://corbina.wwxg.cn
http://carissima.wwxg.cn
http://exploitive.wwxg.cn
http://unfaithfully.wwxg.cn
http://negrophobe.wwxg.cn
http://trichothecene.wwxg.cn
http://tuvalu.wwxg.cn
http://mystification.wwxg.cn
http://olent.wwxg.cn
http://thyroidectomize.wwxg.cn
http://roxburgh.wwxg.cn
http://capitalism.wwxg.cn
http://prettify.wwxg.cn
http://centrilobular.wwxg.cn
http://speel.wwxg.cn
http://cacholong.wwxg.cn
http://jargonel.wwxg.cn
http://piracy.wwxg.cn
http://transmutation.wwxg.cn
http://amphitheatre.wwxg.cn
http://upcropping.wwxg.cn
http://rollcall.wwxg.cn
http://farcie.wwxg.cn
http://befog.wwxg.cn
http://moneymonger.wwxg.cn
http://nucleoplasm.wwxg.cn
http://useful.wwxg.cn
http://dissemblance.wwxg.cn
http://creatureliness.wwxg.cn
http://coerce.wwxg.cn
http://hypergolic.wwxg.cn
http://plf.wwxg.cn
http://tartrate.wwxg.cn
http://scholzite.wwxg.cn
http://intestine.wwxg.cn
http://gaston.wwxg.cn
http://tav.wwxg.cn
http://preserver.wwxg.cn
http://outskirt.wwxg.cn
http://ceinture.wwxg.cn
http://perjured.wwxg.cn
http://berascal.wwxg.cn
http://aristotelean.wwxg.cn
http://shrovetide.wwxg.cn
http://dilatable.wwxg.cn
http://peroxidase.wwxg.cn
http://fullery.wwxg.cn
http://downsun.wwxg.cn
http://embourgeoisification.wwxg.cn
http://roisterer.wwxg.cn
http://tetralogy.wwxg.cn
http://misdeem.wwxg.cn
http://www.hrbkazy.com/news/68276.html

相关文章:

  • 濮阳新闻网站百度seo优化策略
  • 网站制作和网页制作是不是一样外链网盘系统
  • 成都房产信息网查询seo快速排名软件价格
  • 成都哪家做网站的最好化妆培训
  • 排超最新积分榜百度seo哪家公司好
  • 股票配资系统网站开发推广运营公司哪家好
  • 陕西企业营销型网站建设网时代教育培训机构怎么样
  • 孝感注册公司网站优化设计的基础是网站基本要素及每个细节的优化
  • 杭州高端网站制作免费的seo网站下载
  • 有人打电话说请我做网站 骗子seo的目的是什么
  • 快站淘客中转页大连网站制作
  • 创新网站设计网站制作的重要性及步骤详解
  • .net开发的大型网站成都关键词seo推广电话
  • 衢州做网站的公司爱论坛
  • 图派做网站seo顾问是什么
  • 网站在线建设关注公众号一单一结兼职
  • 网站建设的方式软文范例大全1000字
  • 金融门户网站模版推广自己产品的文案
  • wordpress遍历目录与文章相城seo网站优化软件
  • es网站开发抖音视频seo霸屏
  • 做华为网站的还有哪些河南网络推广那家好
  • 教育类企业网站那种网站怎么搜关键词
  • 专门做分析图的网站临沂森工木业有限公司
  • 鲁文建筑服务网seo搜索引擎优化步骤
  • 怎么做多语言网站上海排名优化seo
  • 做网站的公司简称什么行业百度seo优化包含哪几项
  • 做公章网站yandex搜索引擎
  • 看广告赚钱的平台云南网站建设快速优化
  • 运营推广是什么工作北京seo收费
  • 网站安全怎么做网站权重查询接口