2019年9月17日

Using Spring Boot —— Using the @SpringBootApplication Annotation

摘要: 注解@SpringBootApplication相当于下面三个注解: @EnableAutoConfiguration 自动配置 @ComponentScan 扫描指定包下的所有@Component @Configuration 允许注册@Bean / 导入Configuration类(@Impor 阅读全文

posted @ 2019-09-17 10:24 李笑白 阅读(98) 评论(0) 推荐(0) 编辑

Using Spring Boot —— Spring Beans and Dependency Injection

摘要: Spring Beans @ComponentScan 扫描指定包下的@Component @Controller @Service @Respository类 @Autowired 自动注入bean,可以在属性/构造方法/set方法上使用 阅读全文

posted @ 2019-09-17 10:12 李笑白 阅读(108) 评论(0) 推荐(0) 编辑

2019年9月11日

Using Spring Boot —— Auto-configuration

摘要: Spring Boot auto-configuration尝试基于依赖的jar 自动配置Spring应用程序。需要添加@EnableAutoConfiguration(或者SpringBootApplication)注解 到 @Configutation类中的一个。 1.自动配置非侵入性 在任何时 阅读全文

posted @ 2019-09-11 14:15 李笑白 阅读(296) 评论(0) 推荐(0) 编辑

Using Spring Boot —— Configuration Classes

摘要: springboot支持java代码配置,尽管可以使用xml配置,但是我们建议你的主要配置可以使用一个 @Configuration 类。通常,定义main方法的类很适合作为主要的@Configuration。 1. 导入配置类 用@Import注解导入; 将@Configuration类放到@Co 阅读全文

posted @ 2019-09-11 12:27 李笑白 阅读(159) 评论(0) 推荐(0) 编辑

Using Spring Boot —— Structuring Your Code

摘要: 1.使用默认包。 不要将扫描类放到默认包下 2. Main Application Class 使用SpringBootApplication注解,它包含了下面三条注解: @EnableAutoConfiguration: enable Spring Boot’s auto-configuratio 阅读全文

posted @ 2019-09-11 11:58 李笑白 阅读(117) 评论(0) 推荐(0) 编辑

Using Spring Boot —— Build Systems

摘要: 使用spring boot —— maven构建 1.继承 starter parent 2.如果你的系统pom已经有自定义的parent,又想使用springboot。还可以直接添加如下依赖: 3. Spring Boot包含一个Maven插件,可以将项目打包为可执行jar。需要在pom中添加如下 阅读全文

posted @ 2019-09-11 11:42 李笑白 阅读(117) 评论(0) 推荐(0) 编辑

Spring @import注解

摘要: 参考:https://blog.csdn.net/boling_cavalry/article/details/82530167 常见的四种Import注解用法列举:在@Import注解的参数中可以填写类名,例如@Import(Abc.class),根据类Abc的不同类型,spring容器有以下四种 阅读全文

posted @ 2019-09-11 10:59 李笑白 阅读(322) 评论(0) 推荐(0) 编辑

2019年8月13日

Stack

摘要: 栈,只有栈顶可以操作,先进后出,后进先出。 java中的Stack 继承了Vector类,是线程安全的。 参考:https://blog.csdn.net/f2006116/article/details/51375225 栈的使用: 中缀表达式转后缀,然后计算表达式的值。 中缀(1+3*(9-2) 阅读全文

posted @ 2019-08-13 11:23 李笑白 阅读(262) 评论(0) 推荐(0) 编辑

2019年8月12日

Set TreeSet

摘要: package com.dh.learn.collection; import java.util.Set; import java.util.TreeSet; public class LearnTreeSet { public static void main(String[] args) { //TreeSet会按照元素顺序排序。是用TreeMap的key实现的... 阅读全文

posted @ 2019-08-12 18:06 李笑白 阅读(157) 评论(0) 推荐(0) 编辑

Set HashSet

摘要: package com.dh.learn.collection; import java.util.HashSet; import java.util.Set; public class LearnHashSet { public static void main(String[] args) { Set set = new HashSet(); se... 阅读全文

posted @ 2019-08-12 17:36 李笑白 阅读(96) 评论(0) 推荐(0) 编辑

导航