Spring Boot 2,java面试总结架构师中间件

2018-03-07 18:15:18.591 INFO 83387 — [ main] com.didispace.Application : Starting Application on zhaiyongchaodeMacBook-Pro.local with PID 83387 (/Users/zhaiyongchao/Documents/git/github/SpringBoot-Learning/Chapter1-2-1/target/classes started by zhaiyongchao in /Users/zhaiyongchao/Documents/git/github/SpringBoot-Learning/Chapter1-2-1)

2018-03-07 18:15:18.591 INFO 83387 — [ main] com.didispace.Application : No active profile set, falling back to default profiles: default

2018-03-07 18:15:18.658 INFO 83387 — [ main] c.d.ApplicationPreparedEventListener : …ApplicationPreparedEvent…

2018-03-07 18:15:18.662 INFO 83387 — [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@20d3d15a: startup date [Wed Mar 07 18:15:18 CST 2018]; root of context hierarchy

2018-03-07 18:15:19.879 INFO 83387 — [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)

2018-03-07 18:15:19.926 INFO 83387 — [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]

2018-03-07 18:15:19.930 INFO 83387 — [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.28

2018-03-07 18:15:19.946 INFO 83387 — [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/zhaiyongchao/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]

2018-03-07 18:15:20.068 INFO 83387 — [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext

2018-03-07 18:15:20.068 INFO 83387 — [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1410 ms

2018-03-07 18:15:20.210 INFO 83387 — [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]

2018-03-07 18:15:20.214 INFO 83387 — [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: ‘characterEncodingFilter’ to: [/*]

2018-03-07 18:15:20.214 INFO 83387 — [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: ‘hiddenHttpMethodFilter’ to: [/*]

2018-03-07 18:15:20.214 INFO 83387 — [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: ‘httpPutFormContentFilter’ to: [/*]

2018-03-07 18:15:20.215 INFO 83387 — [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: ‘requestContextFilter’ to: [/*]

2018-03-07 18:15:20.513 INFO 83387 — [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@20d3d15a: startup date [Wed Mar 07 18:15:18 CST 2018]; root of context hierarchy

2018-03-07 18:15:20.592 INFO 83387 — [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped “{[/error]}” onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)

2018-03-07 18:15:20.593 INFO 83387 — [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped “{[/error],produces=[text/html]}” onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)

2018-03-07 18:15:20.623 INFO 83387 — [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]

2018-03-07 18:15:20.623 INFO 83387 — [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]

2018-03-07 18:15:20.660 INFO 83387 — [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]

2018-03-07 18:15:20.787 INFO 83387 — [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup

2018-03-07 18:15:20.839 INFO 83387 — [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ‘’

2018-03-07 18:15:20.843 INFO 83387 — [ main] com.didispace.Application : Started Application in 2.866 seconds (JVM running for 3.337)

2018-03-07 18:15:20.845 INFO 83387 — [ main] c.d.ApplicationStartedEventListener : …ApplicationStartedEvent…

2018-03-07 18:15:20.847 INFO 83387 — [ main] c.d.ApplicationReadyEventListener : …ApplicationReadyEvent…

从日志中我们可以看到清晰的看到ApplicationPreparedEventApplicationStartedEvent以及ApplicationReadyEvent三个事件的切入点。通过这个例子可能读者会感到疑问:ApplicationStartedEventApplicationReadyEvent从事件命名和日志输出位置来看,都是应用加载完成之后的事件,它们是否有什么区别呢?

下面可以看看官方文档对ApplicationStartedEventApplicationReadyEvent的解释:

An ApplicationStartedEvent is sent after the context has been refreshed but before any application and command-line runners have been called.An ApplicationReadyEvent is sent after any application and command-line runners have been called. It indicates that the application is ready to service requests

从文档中我们可以知道他们两中间还有一个过程就是command-line runners被调用的内容。所以,为了更准确的感受这两个事件的区别,我们在应用主类中加入CommandLineRunner的实现,比如:

@Slf4j

@SpringBootApplication

public class Application {

public static void main(String[] args) {

SpringApplication.run(Application.class, args);

}

@Bean

public DataLoader dataLoader() {

return new DataLoader();

}

@Slf4j

static class DataLoader implements CommandLineRunner {

@Override

public void run(String… strings) throws Exception {

log.info(“Loading data…”);

}

}

}

最后,我们再运行程序,此时我们可以发现这两个事件中间输出了上面定义的DataLoader的输出内容,具体如下:

2018-03-07 18:15:20.845 INFO 83387 — [main] c.d.ApplicationStartedEventListener : …ApplicationStartedEvent…

2018-03-07 18:15:20.846 INFO 83387 — [main] com.didispace.Application$DataLoader : Loading data…

2018-03-07 18:15:20.847 INFO 83387 — [main] c.d.ApplicationReadyEventListener : …ApplicationReadyEvent…

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数Java工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
img
img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Java开发知识点,真正体系化!

img
img

由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新
如果你觉得这些内容对你有帮助,可以添加V:vip1024b 备注Java获取(资料价值较高,非无偿)
img

最后

在面试前我整理归纳了一些面试学习资料,文中结合我的朋友同学面试美团滴滴这类大厂的资料及案例

MyBatis答案解析
由于篇幅限制,文档的详解资料太全面,细节内容太多,所以只把部分知识点截图出来粗略的介绍,每个小节点里面都有更细化的内容!

大家看完有什么不懂的可以在下方留言讨论也可以关注。

觉得文章对你有帮助的话记得关注我点个赞支持一下!
9)]

[外链图片转存中…(img-EwcYWDxy-1711578879820)]
由于篇幅限制,文档的详解资料太全面,细节内容太多,所以只把部分知识点截图出来粗略的介绍,每个小节点里面都有更细化的内容!

大家看完有什么不懂的可以在下方留言讨论也可以关注。

觉得文章对你有帮助的话记得关注我点个赞支持一下!

  • 21
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值