您的位置:首页 > 编程语言 > Java开发

springboot启动过程

2017-01-03 00:00 423 查看
摘要: springboot启动

如果是使用了web-Starter

启动一个线程

是否启用spring切面

自动嵌入注解配置

tomcat启动

启动tomcat

tomcat的servlet引擎启动

初始化 spring嵌入WebApplicationContext

WebApplicationContext初始化完成

在servlet注册类中注册servlet-使用默认的servlet

在filter注册类中
* 注册filter-使用metricFilter
* 注册filter-使用 characterEncodingFilter
* 注册filter-使用 hiddenHttpMethodFilter
* 注册filter-使用 httpPutFormContentFilter
* 注册filter-使用 requestContextFilter
* 注册filter-使用 webRequestLoggingFilter
* 注册filter-使用 applicationContextIdFilter

@ControllerAdvice 查找控制器增强器

在Controller中匹配

BasicErrorController 错误页面 Mapped "{[/error]}",Mapped "{[/error],produces=[text/html]}"

ResourceHttpRequestHandler Mapped URL path [/webjars/],Mapped URL path [/],Mapped URL path [/**/favicon.ico]

HealthMvcEndpoint Mapped "{[/health || /health.json],produces=[application/json]}"

EndpointMvcAdapter

Mapped "{[/mappings || /mappings.json],methods=[GET],produces=[application/json]}",

Mapped "{[/info || /info.json],methods=[GET],produces=[application/json]}" ,

Mapped "{[/metrics || /metrics.json],methods=[GET],produces=[application/json]}" ,

{[/dump || /dump.json],methods=[GET],produces=[application/json]}" ,

{[/configprops || /configprops.json],methods=[GET],produces=[application/json]},

{[/autoconfig || /autoconfig.json],methods=[GET],produces=[application/json],

{[/beans || /beans.json],methods=[GET],produces=[application/json]}

{[/env/{name:.*}],methods=[GET],produces=[application/json]}

{[/env || /env.json],methods=[GET],produces=[application/json]}

{[/trace || /trace.json],methods=[GET],produces=[application/json]}

MetricsMvcEndpoint Mapped "{[/metrics/{name:.*}],methods=[GET],produces=[application/json]}",

HeapdumpMvcEndpoint {[/heapdump || /heapdump.json],methods=[GET],produces=[application/octet-stream]},

登记beans到JMX中

tomcat启动成功

服务启动成功。共耗时为多长
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: