摘要:
SpringBoot注解配置文件自动映射到属性和实体类 Controller上面配置 @Component @PropertySource({"classpath:application.properties"}) @ConfigurationProperties 属性上面配置 @Value("${ 阅读全文
摘要:
使用springboot结合dev-tool工具 1.添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true< 阅读全文
摘要:
springboot文件上传 MultipartFile file,源自SpringMVC MultipartFile 对象的transferTo方法,用于文件保存(效率和操作比原先用FileOutStream方便和高效) 启动类里面配置 @Bean public MultipartConfigEl 阅读全文
摘要:
目录讲解 src/main/java:存放java代码 src/main/resources/static 存放静态文件,比如 css、js、image templates:存放静态页面jsp,html,tpl config:存放配置文件,application.properties 引入依赖 Th 阅读全文
摘要:
常用框架 阿里 fastjson,谷歌gson等 JavaBean序列化为Json, 性能:Jackson > FastJson > Gson > Json-lib 同个结构 Jackson、FastJson、Gson类库各有优点,各有自己的专长 空间换时间,时间换空间 github代码地址 htt 阅读全文
摘要:
@RestController and @RequestMapping是springMVC的注解,不是springboot特有的 @RestController = @Controller+@ResponseBody @SpringBootApplication = @Configuration+@ 阅读全文
摘要:
spirngboot依赖环境 依赖版本jdk8以上, Springboot2.x用JDK8, 因为底层是 Spring framework5 安装maven最新版本,maven3.2以上版本,下载地址 :https://maven.apache.org/download.cgi 开发工具IDEA s 阅读全文