![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SpringBoot
SpringBoot框架操作
樱庭鸑鷟
这个作者很懒,什么都没留下…
展开
-
StringBoot(多数据源的使用)
首先添加依赖:<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-jdbc</artifactId></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-j原创 2020-06-26 09:10:51 · 146 阅读 · 0 评论 -
SpringBoot(WebSocket聊天室)
WebSocket 事件Websocket 使用 ws 或 wss 的统⼀资源标志符,类似于 HTTPS,其中 wss 表示在 TLS 之上的 Websocket。ws://example.com/wsapiwss://secure.example.com/Websocket 使用和 HTTP 相同的 TCP 端⼝口,可以绕过大多数防⽕墙的限制。默认情况下,Websocket 协议使用80 端口;运行在 TLS 之上时,默认使用 443 端口。、事件事件处理理程序描述ope原创 2020-06-22 20:09:08 · 238 阅读 · 0 评论 -
SpringBoot(FastDFS文件上传)
FastDFS 相关概念FastDFS 服务端有三个⻆色:跟踪服务器(Tracker Server)、存储服务器(Storage Server)和客户端(Client)。Tracker Server: 跟踪服务器,主要做调度工作,起负载均衡的作⽤用。在内存记录集群中所有存储组和存储服务器的状态信息,是客户端和数据服务器交互的枢纽。相⽐ GFS 中的 Master 更为精简,不记录文件索引信息,占用的内存量很少。Storage Server: 存储服务器(⼜称存储节点或数据服务器),文件和⽂件属性(Me原创 2020-06-21 09:43:58 · 483 阅读 · 0 评论 -
SpringBoot(Thymeleaf 页⾯布局)
模板使用Spring Boot 2.0 将布局单独提取了出来,需要单独引⼊入依赖:thymeleaf-layout-dialect<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-thymeleaf</artifactId></dependency><dependency><grou原创 2020-06-20 10:48:33 · 238 阅读 · 0 评论 -
StringBoot(模板 Thymeleaf 高阶用法)
内联 [ [ ] ]内联⽂本:[ […] ] 内联文本的表示方式,使⽤时,必须先⽤th:inline=“text/javascript/none” 激活,th:inline 可以在父级标签内使⽤,甚⾄可以作为 body 的标签。内联⽂本⽐ th:text 的代码少,不利于原型显示。⻚页⾯面 inline.html(⽂文本内联):<div><h1>内联</h1><div th:inline="text" ><p>Hello, [[${us原创 2020-06-19 11:36:20 · 209 阅读 · 0 评论 -
SpringBoot(模板Thymeleaf)
模板Thymeleaf相关配置:<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-thymeleaf</artifactId></dependency>在 application.properties 中添加配置:spring.thymeleaf.cache=false其中,properties原创 2020-06-12 22:28:11 · 173 阅读 · 0 评论 -
SpringBoot(使用jsp时对idea进行配置)
如果像其他项⽬目⼀一样,直接在 IDEA 中通过 main ⽅方法来启动项⽬目,在访问测试的时候会出现 404 notfound。需配置:1、2、如果在单独的 Tomcat 中运⾏1、在 pom.xml ⾥里里设置打包格式为 war<packaging>war</packaging>2、排除内嵌的 Tomcat 依赖<dependency><groupId>org.springframework.boot</groupId>原创 2020-06-12 21:29:29 · 117 阅读 · 0 评论 -
SpringBoot(JSP的使用)
项目结构:spring-boot-jsp+-src +- main +- java +- resources +- webapp +- WEB-INF +- jsp +- welcome.jsp +- test +-pom.xml1、配置首先需要在配置文件中添加指定的jsp的位置和后缀spring.mvc.view.prefix: /WEB-INF/jsp/spring.mvc.view.suffix: .jsp...原创 2020-06-12 21:21:10 · 140 阅读 · 0 评论 -
SpringBoot(读取配值文件里面的属性)
如何读取配值文件里面的属性?1、@PropertySource配置文件路径设置,在类上添加注解,如果在默认路径下可以不添加该注解。@PropertySource({"classpath:config/my.properties","classpath:config/config.properties"})public class TestController例如非application.properties,classpath:config/my.properties指的是src/main/res原创 2020-06-11 20:51:53 · 219 阅读 · 0 评论 -
SpringBoot笔记(主程序类@SpringBootApplication详解)
主程序类:@SpringBootApplication:Spring Boot 应用标注在某个类上说明这个类是SpringBoot的主配置类,SpringBoot就应该运行这个main方法来启动SpringBoot应用。@SpringBootConfiguration:SpringBoot的配置类@Configuration:配置类上来标注这个注解;配置类------配置文件:配置类也是容器中的一个组件:@Component@EnableAutoConfiguration:开启自动配置功能;以前原创 2020-06-08 17:17:31 · 210 阅读 · 0 评论