• springboot pom问题及注解


    springboot pom不需要指定版本号 springboot会自己管理版本号

     <!-- 支持热部署 -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-devtools</artifactId>
                <optional>true</optional>
            </dependency>

    注意 : 更改完java代码需要重新编译 ctrl+f9,否则依然没用

    @Component 加载到容器中

    @ConfigurationProperties(prefix = "person") 加上该注解后,就会注入在application.properties中server开头的属性

    @Configuration  加上这个的类代表spring IOC容器

    这个相当于bean

    @Import 多个配置文件整合在一起中间用逗号隔开

    @SpringBootTest 配置文件属性的读取

    @RunWith(SpringRunner.class) 当一个类用@RunWith注释或继承一个用@RunWith注释的类时,

                  JUnit将调用它所引用的类来运行该类中的测试而不是开发者去在junit内部去构建它。我们在开发过程中使用这个特性。

     @ConfigurationProperties和@value的区别

    @propertySource("classPath:...")  指定读取配置文件

    @ImportResource 导入spring配置文件 让配置文件里面的内容生效

  • 相关阅读:
    openwrt 汉化
    错误: libstdc++.so.6: cannot open shared object file: No such file or directory
    openwrt uci
    openwrt makefile选项
    Ubuntu服务器断网问题解决
    lldpcli 常用命令
    openwrt ramips随记
    shell脚本学习(二)
    完成响应式的方式
    盒子模型 W3C中和IE中盒子的总宽度分别是什么
  • 原文地址:https://www.cnblogs.com/ch94/p/10369907.html
Copyright © 2020-2023  润新知