
SpringBoot
关于springboot的一些记录
CCSway
Stay hungry Stay foolish
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
SpringBoot文件上传(Ajax)
1.准备前端页面 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>fileup</title> <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script> </head> <body>原创 2020-06-22 16:15:10 · 535 阅读 · 0 评论 -
SpringBoot添加thymeleaf模板
springboot整合thymeleaf十分简单,你不用做任何配置,只需要添加thymeleaf依赖即可直接使用。下面给出例子。 1.创建springboot工程添加依赖 当然也可以直接在工程的pom文件中添加: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymelea原创 2020-06-22 11:06:12 · 730 阅读 · 0 评论 -
SpringBoot属性注入
这里写出两种从properties文件中获得属性值得两种方式 你可以自己创建一个properties,当然也可以使用默认的application.properties。 book.properties内容如下 book.name=ll book.price=30 1.使用@Value @Component //如果是使用自己定义的properties需要下面的注解注明位置,如果写在application.properties中则不需要 @PropertySource("classpath:book.pr原创 2020-06-22 10:04:59 · 203 阅读 · 0 评论