赞
踩
简化Spring应用开发的一个框架;
整个Spring技术栈的一个大整合;
J2EE开发的一站式解决方案;
微服务:架构风格(服务微化)
一个应用应该是一组小型服务;可以通过HTTP的方式进行互通;
单体应用:ALL IN ONE
微服务:每一个功能元素最终都是一个可独立替换和独立升级的软件单元;
只有这个组件是容器中的组件,才能使用容器提供的@ConfigurationProperties功能;
@PropertySource(value = {"classpath:person.properties"})
@Component
@ConfigurationProperties(prefix = "person")
@Value获取值和@ConfigurationProperties获取值比较:
由于SpringBoot默认是以jar包的方式启动嵌入式的Servlet容器来启动SpringBoot的web应用,没有web.xml文件。
// 注册Servlet服务 @Bean public ServletRegistrationBean myServlet(){ ServletRegistrationBean registrationBean = new ServletRegistrationBean(new MyServlet(),"/myServlet"); return registrationBean; } // 注册过滤器 @Bean public FilterRegistrationBean myFilter(){ FilterRegistrationBean registrationBean = new FilterRegistrationBean(); registrationBean.setFilter(new MyFilter()); registrationBean.setUrlPatterns(Arrays.asList("/hello","/myServlet")); return registrationBean; } // 注册监听器 @Bean public ServletListenerRegistrationBean myListener(){ ServletListenerRegistrationBean<MyListener> registrationBean = new ServletListenerRegistrationBean<>(new MyListener()); return registrationBean; }
https://gitee.com/laocou/SpringBoot.git
关于SpringBoot 整合第三方插件的使用,上述链接的gitee代码中有详细介绍。
上面只简单列出的SpringBoot最重要的基本概念。强烈建议大家将代码下载到本地,链接如下:https://gitee.com/laocou/SpringBoot.git。从头到尾整体过几遍,形成一个完整的知识框架,链接中这些内容已经基本覆盖平时项目开发中所用的知识点。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。