2018年7月17日
摘要: 现在来介绍SpringBoot基于jpa对MySQL进行操作。 既然是数据库操作总有点目标和资源吧, 现在来做一个:《万界神兵录》收集一下天下神兵,从剑开始 一.前期准备1.个人还是比较喜欢自己建表:建表CREATE TABLE sword... 阅读全文
posted @ 2018-07-17 17:27 张风捷特烈 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 笔者知道这招非常高兴,SpringBoot本身集成TomCat等web服务器, Tomcat用的比较熟,但怎么访问上传进来的文件呢?Root文件夹都没有。 难道部署到服务器上,还要在服务器上开个Tomcat?我相信SpringBoot应该不会这样... 阅读全文
posted @ 2018-07-17 17:26 张风捷特烈 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 需要使用引擎模板thymeleaf,如果不清楚,可见04–SpringBoot之模板引擎–thymeleaf1.新建表单网页:templates/upfile.html Title 文件上传 2.控制器:toly1994.com... 阅读全文
posted @ 2018-07-17 17:25 张风捷特烈 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 一.前期工作1.添加依赖 org.springframework.boot spring-boot-starter-thymeleaf2.thymeleaf 静态资源配置:src\main\resources\application-dev.... 阅读全文
posted @ 2018-07-17 17:24 张风捷特烈 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 避免修改内容后必须重启才能再继续玩耍1:添加依赖:toly01\pom.xml org.springframework.boot spring-boot-devtools ... 阅读全文
posted @ 2018-07-17 17:23 张风捷特烈 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 一:url传参1.get方式Url传参:@PathVariable ////------get方式Url传参 @GetMapping({"/id/{the_Param}"}) public String id(@PathVariable... 阅读全文
posted @ 2018-07-17 17:22 张风捷特烈 阅读(678) 评论(0) 推荐(0) 编辑
摘要: 一.创建一个项目:IDE为IDEA二.新建一个Controller类: toly1994.com.toly01.controller.HelloSpringBoot@RestController public class HelloSpringBoot {... 阅读全文
posted @ 2018-07-17 17:21 张风捷特烈 阅读(143) 评论(0) 推荐(0) 编辑
摘要: src\main\resources\banner.txt ${AnsiColor.BLUE} _|_|_|_|_| _|_| _| _| _| _| _|_| _|_| _| _| ... 阅读全文
posted @ 2018-07-17 17:20 张风捷特烈 阅读(403) 评论(0) 推荐(0) 编辑
摘要: 这篇将结合引擎模板thymeleaf,mysql数据库jap,简单的jQuery和vue。来构建一个图片上传和展示的小案例其中maven配置,及配置文件配置这里就不废话了,详见:04--SpringBoot之模板引擎--thymelea... 阅读全文
posted @ 2018-07-17 17:11 张风捷特烈 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 为及时了解异常,以及避免返回的json格式不统,将每次请求的结果都返还一样的形式。此处统一为:{"code":响应代号码,"msg":信息,"data":数据} 具体效果如下:result--format.png1.格式化请求返回值Be... 阅读全文
posted @ 2018-07-17 16:23 张风捷特烈 阅读(356) 评论(0) 推荐(0) 编辑