springboot
springboot学习教程项目github地址
https://github.com/heng1234/spring-boot_one
hlvy
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
SpringBoot 外置tomcat引入本地jar包不了的解决办法
问题: springboot多模块项目(内置tomcat可以 但是需要把jar加入主模块) 外置tomcat 引入后启动运行后调接口方的方法时说找不到这个方法 排查后是jar没引入进来(外置的加入主模块也无效果) 可是我这用idea的方式引入jar 这样引入的jar (idea引入方式具体百度) 后面在jar扔到tomcat 也没用 还报jar冲突 但是我把引入的都删了 才扔到tomc...原创 2018-11-29 14:32:03 · 1828 阅读 · 0 评论 -
springboot多模块化
首先创建一个springboot项目 结构如下 User: package com.hlvy.dmkh.entity; /** * User * * @author heng **/ public class User { private String name; private int age; public User() { } ...原创 2018-11-02 10:38:10 · 2755 阅读 · 0 评论 -
maven互相依赖
A的pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://mav原创 2018-11-02 09:27:42 · 677 阅读 · 0 评论 -
@JsonProperty序列化和反序列化
@JsonProperty("this_name") private String thisName; 被注解标识后,controller返回序列化参数后变为this_name,当接受application/json编码格式的参数时, 同样需要接收参数为this_name的参数.但是当用表单提交时,则必须传thisName或ThisName才能接收 原文:https:...转载 2018-10-26 17:06:15 · 3342 阅读 · 0 评论 -
springboot+dubbo+thymeleaf模板+bootstrap+mysql数据库+redis缓存数据库 项目例子
做了增删改查及redis缓存 处理了缓存穿透问题 项目直接可运行 github地址: https://github.com/heng1234/springboot原创 2018-10-03 21:45:30 · 476 阅读 · 0 评论 -
idea中springboot项目使用lombok 插件
lombok 作用 通过lombok注解减少getter、setter等方法的编写,在更改实体类时只需要修改属性即可,减少了很多重复代码的编写工作 编译时会自动生成getter、setter等方法 收先在idea安装lombok 插件 接着把enable...这个勾上 如图 在pom.xml加上lombok 的jar <!--lombok--> ...翻译 2018-10-26 13:16:00 · 2334 阅读 · 0 评论 -
springboot使用已封装好的redis工具类进行操作
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 工具类 RedisOperator package com.imooc.utils; import java.util.Map; import java.util.Set; import java.util.concurrent.Tim...翻译 2018-09-07 17:22:40 · 2890 阅读 · 1 评论 -
springboot整合定时任务task及定时任务表达式的简单讲解与应用
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 springboot整合定时任务task 启动类加上定时任务注解 //开启定时任务 @EnableScheduling 建立定时任务类 范例: TestTask package com.imooc.tasks; import...翻译 2018-09-07 17:25:34 · 410 阅读 · 0 评论 -
springboot整合异步任务以及使用场景
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 启动类加上注解 //开启异步调用方法 @EnableAsync 定义一个异步任务执行类 AsyncTask package com.imooc.tasks; import java.util.concurrent.Future; im...翻译 2018-09-07 17:27:26 · 597 阅读 · 0 评论 -
springboot中如何使用拦截器
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 WebMvcConfigurer package com.imooc.config; import org.springframework.context.annotation.Configuration; import org....翻译 2018-09-07 17:28:35 · 842 阅读 · 0 评论 -
Idea springboot热部署
首先pom加上 <!-- 热部署 --> <!-- devtools可以实现页面热部署(即页面修改后会立即生效, 这个可以直接在application.properties文件中配置spring.thymeleaf.cache=false来实现) --> <!-- 实现类文件热部署(类文件修改后不会立即生效),实现对属性文件的热部署。 --> ...原创 2018-09-10 10:12:01 · 289 阅读 · 0 评论 -
vue封装axios请求springboot 及跨域问题
vue页面 安装element-ui npm install element-ui --save 安装axios插件 npm install axios --save 创建个http.js import axios from 'axios'; import { Message } from 'element-ui'; axios.defaults.timeout = 5...原创 2018-09-10 17:33:01 · 9016 阅读 · 1 评论 -
Springboot整合freemarker
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 配置文件 Properties 配置 ############################################################ # # freemarker 静态资源配置 # ################...翻译 2018-09-06 09:57:25 · 272 阅读 · 0 评论 -
SpringBoot配置全局的异常捕获 - web页面跳转
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 ErrorController /** * 不是ajax形式访问 * @return */ @RequestMapping("err") public String error() { int res = 1 / 0;...翻译 2018-09-06 10:03:05 · 708 阅读 · 0 评论 -
SpringBoot配置全局的异常捕获 - ajax形式
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 异常处理类: package com.yh.exception; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRespo...翻译 2018-09-06 10:08:58 · 479 阅读 · 0 评论 -
SpringBoot配置全局的异常捕获 - 同时兼容web与ajax
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 结合前面2个web和ajax处理看 异常处理类 package com.yh.exception; import javax.servlet.http.HttpServletRequest; import javax.servlet.htt...翻译 2018-09-06 10:13:25 · 664 阅读 · 3 评论 -
整合MyBatis - 使用generatorConfig生成mapper以及pojo
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 pom文件引入 <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> ...翻译 2018-09-06 10:21:31 · 521 阅读 · 0 评论 -
整合MyBatis - 实现基于mybatis的CRUD功能
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 pom文件: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="ht...翻译 2018-09-06 10:26:44 · 293 阅读 · 0 评论 -
整合MyBatis - 使用pagehelper实现分页
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 pom需要加入pagehelper的jar service /** * 分页查询 */ @Override @Transactional(propagation=Propagation.SUPPORTS) publi...翻译 2018-09-06 10:29:53 · 342 阅读 · 0 评论 -
整合MyBatis - 自定义mapper的实现
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 这里不用进行配置了因为在启动类进行了全包扫描 Mapper定义一个mapper接口 package com.yh.mapper; import java.util.List; import com.yh.pojo.TUs...翻译 2018-09-06 10:43:11 · 2563 阅读 · 0 评论 -
整合MyBatis - 引入事务执行回滚
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 Service上加上事务注解 @Transactional(propagation = Propagation.xxx) 例如 @Transactional(propagation = Propagation.RE...翻译 2018-09-06 10:43:51 · 1347 阅读 · 0 评论 -
springboot整合缓存Redis
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 <!-- 引入 redis 依赖 --> <dependency> <groupId>org.springframework.boot</groupId> ...翻译 2018-09-06 10:46:35 · 177 阅读 · 0 评论 -
springboot整合thymeleaf及常用标签的使用方法
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 pom.xml <!-- 引入 thymeleaf 模板依赖 --> <dependency> <groupId>org.springframework.boot</groupId>...翻译 2018-08-28 14:45:35 · 625 阅读 · 0 评论 -
eclipse springboot 热部署方法
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 <!-- 热部署 --> <!-- devtools可以实现页面热部署(即页面修改后会立即生效, 这个可以直接在application.properties文件中配置spring.thymeleaf.cache=fa...翻译 2018-08-25 17:11:57 · 1257 阅读 · 0 评论 -
Springboot jackson
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 @@JsonIgnore controller返回对象会忽略对象里属性有这个注解的 格式化次标有此注解date类型的属性 @JsonFormat(pattern="yyyy-MM-dd hh:mm:ss a", locale="zh...翻译 2018-08-28 14:57:33 · 737 阅读 · 0 评论 -
Springboot 资源配置
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 Pom.xml引入 <!-- 用于读取配置文件包--> <dependency> <groupId>org.springframework.boot</groupId> <...翻译 2018-08-28 15:04:07 · 237 阅读 · 0 评论 -
SpringBoot 资源文件配置server以及tomcat
请结合springboot学习教程项目github地址 https://github.com/heng1234/spring-boot_one来理解 ############################################################ # # Server 服务端相关配置 # ########################################...翻译 2018-08-28 15:05:08 · 14219 阅读 · 1 评论
分享