
spring
英俊帅比林
我真好看
展开
-
SpringBoot配置thymeleaf
SpringBoot是基于spring的一套非常方便的Web项目开发框架,真正做到了开箱即用,我们只要导入SpringBoot的依赖,然后甚至连tomcat等服务器都不需要安装就可以编写并运行起来一个web项目。然而,SpringBoot并不推荐使用jsp,而是推荐使用thymeleaf。有人可能会说了,这个thymeleaf是个什么东西?为什么那么好用的jsp spring都不推荐使用,反而推荐...原创 2019-01-25 09:42:52 · 451 阅读 · 0 评论 -
SpringBoot集成redis入门教程
1.新建一个springBoot web项目具体教程可以参见此篇博文:https://blog.csdn.net/qq_37856300/article/details/862231342.添加spring-data依赖<dependency> <groupId>org.springframework.boot</groupId> <...原创 2019-04-27 16:19:27 · 248 阅读 · 0 评论 -
@PathVariable用法
带占位符的 URL 是 Spring3.0 新增的功能,通过@PathVariable注解,我们可以获取网络url中的一部分作为controller方法中的参数。使用示例如下:html:<a href="/test/3">java:@RequestMapping("/test/{id}") public void test(@PathVariable("id") In...原创 2019-01-22 13:08:34 · 839 阅读 · 0 评论 -
SpringMVC踩坑:HTTP Status 405 - Request method 'GET' not supported错误
今天在做项目的时候,在a链接后面拼接了一串参数,然后运行,结果浏览器显示:HTTP Status 405 - Request method 'GET' not supported解决方法:将springMVC中对应的controller中的请求方法改成GET:...原创 2018-12-28 15:46:16 · 1676 阅读 · 0 评论 -
springMVC原理解析
springMVC原创 2019-01-02 15:29:58 · 1210 阅读 · 0 评论 -
使用idea创建一个SpringBoot项目
1.新建项目2.新建SpringBoot项目在上面选择JDK,直接使用默认然后点击Next即可3.输入项目信息输入项目的maven坐标和各种详细信息点击Next4.选择Web模板5.输入项目名和项目存储路径点击Finish,创建完成6.创建第一个Controller创建文件,使你的项目目录结构如下图所示:在HelloWorldController中输入如下代码:...原创 2019-01-10 11:59:31 · 475 阅读 · 0 评论 -
SpringBoot+Swagger生成接口文档页面
1.加入maven依赖&lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt; &lt;artifactId&gt;spring-boot-starter-web&am原创 2019-01-10 17:41:11 · 550 阅读 · 0 评论 -
Spring的@GetMapping和@PostMapping注解
@GetMapping是一个组合注解,是@RequestMapping(method = RequestMethod.GET)的缩写。@PostMapping是一个组合注解,是@RequestMapping(method = RequestMethod.POST)的缩写。原创 2019-01-11 17:14:10 · 1101 阅读 · 2 评论 -
将springBoot项目打成jar包部署到linux服务器
使用idea,点击右侧的maven选项:双击package:等待打包完成,去对应的目录找到jar包:将jar包上传到linux服务器的文件夹中运行注意,如果我们单纯在服务器上运行jar包,随着我们linux用户的断开远程连接,程序也会停止,因此我们要用后台运行的方式去运行这个程序:在jar包所在的目录直接输入命令运行:nohup java -jar xxx.jarxxx就是我们...原创 2019-01-21 14:34:55 · 2619 阅读 · 0 评论 -
spring中@RequestParam和@RequestBody的区别
a原创 2019-01-22 10:50:40 · 179 阅读 · 0 评论 -
使用spring-data配置实现mongoDB增删改查
1.安装配置mongoDB并启动具体操作请参见此篇博客:https://www.jianshu.com/p/7241f7c83f4a2.新建一个springBoot java web项目具体操作请见此篇博客:https://blog.csdn.net/qq_37856300/article/details/862231343.新建一个实体类Personimport lombok.Data...原创 2019-05-03 20:58:27 · 605 阅读 · 0 评论