springboot
文章平均质量分 88
fangwenzheng88
这个作者很懒,什么都没留下…
展开
-
Spring Boot校验
开发web项目有时候我们需要对controller层传过来的参数进行一些基本的校验,比如非空,非null,整数值的范围,字符串的个数,日期,邮箱等等。最常见的就是我们直接写代码校验,这样以后比较繁琐,而且不够灵活。Bean Validation 1.0(JSR-303)是一个校验规范,在Spring Boot项目由于自带了Hibernate validator 5(http://hiber转载 2017-09-13 21:47:11 · 375 阅读 · 0 评论 -
SpringMVC接收参数与Content-Type关系
1、关于三种 Content-Type这里主要介绍三种 Content-Type:1.1、 multipart/form-data 请求中既可以携带文件,又可以携带参数。其中参数以键值对的方式传递,参数之间、参数与文件之间以 content-disposition 分隔;1.2、 application/x-www-form-urlencoded 只能上传参数,不能携带文件,参数通过 ?x...原创 2019-04-24 22:13:26 · 700 阅读 · 0 评论 -
springboot使用jasypt对的datasource密码加密
springboot版本1.5.9 github文档1.Maven 依赖<!-- 加密工具 --><dependency> <groupId>com.github.ulisesbocchio</groupId> <artifactId>jasypt-spring-boot-starter&l...转载 2017-12-29 15:59:59 · 5080 阅读 · 0 评论 -
springboot集成pageHelper+mapper
1.springboot+pagehelper<!-- Spring Boot 启动父依赖1.5.1 --><parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.1.RELEASE</versi原创 2017-12-25 11:27:57 · 234 阅读 · 0 评论 -
SpringBoot重写addResourceHandlers解决resources下面静态资源无法访问
重写addResourceHandlers()后,\upload\ 下的静态资源可以访问了package com.sd.xm003.config; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.Re转载 2018-01-21 18:29:24 · 1806 阅读 · 0 评论 -
Spring-boot 配置Aop获取controller里的request中的参数以及其返回值
示例:当前url:http://localhost:8080/CarsiLogCenter_new/idpstat.jsp?action=idp.sptopnrequest.getRequestURL() http://localhost:8080/CarsiLogCenter_new/idpstat.jsprequest.getRequestURI() /CarsiLogCen转载 2017-12-01 17:42:59 · 1750 阅读 · 0 评论 -
spring boot+spring security
pom.xml<!-- Spring Boot 启动父依赖 --><parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.2.RELEASE</version></parent><!-- se原创 2017-12-27 17:50:01 · 224 阅读 · 0 评论 -
springboot自定义错误页面
方法一:Spring Boot 将所有的错误默认映射到/error, 实现ErrorController@Controller@RequestMapping(value = "error")public class BaseErrorController implements ErrorController {private static final Logger logger = Logge转载 2017-12-27 17:34:29 · 335 阅读 · 0 评论 -
thymeleaf介绍
thymeleaf介绍简单说, Thymeleaf 是一个跟 Velocity、FreeMarker 类似的模板引擎,它可以完全替代 JSP 。相较与其他的模板引擎,它有如下三个极吸引人的特点:1.Thymeleaf 在有网络和无网络的环境下皆可运行,即它可以让美工在浏览器查看页面的静态效果,也可以让程序员在服务器查看带数据的动态页面效果。这是由于它支持 html 原型,然转载 2017-12-27 17:15:13 · 230 阅读 · 0 评论 -
SpringBoot–集成验证码kaptcha实现验证码功能
<dependency> <groupId>com.github.penggle</groupId> <artifactId>kaptcha</artifactId> <version>2.3.2</version> </dependency> 开始实验: 我们有两种方式在springboot中使用kaptcha第一种使用.xml的配置方式配置生成kapt原创 2017-12-26 10:55:03 · 754 阅读 · 0 评论 -
Spring Boot如何配置日志logback
前言今天来介绍下Spring Boot如何配置日志logback,我刚学习的时候,是带着下面几个问题来查资料的,你呢如何引入日志?日志输出格式以及输出方式如何配置?代码中如何使用?正文Spring Boot在所有内部日志中使用Commons Logging,但是默认配置也提供了对常用日志的支持,如:Java Util Logging,Log4转载 2017-12-25 11:27:14 · 314 阅读 · 0 评论 -
spring-boot 集成mybatis的分页插件PageHelper和Generator (番外)
分页插件PageHelper参看了pagehelper-spring-boot,使用起来非常放方便,关于更多PageHelper可以点击https://github.com/pagehelper/Mybatis-PageHelper。添加maven依赖根据上面地址中的说明,只需要添加如下依赖,并且可以不再mybatis的依赖 com.github.转载 2017-11-04 00:30:43 · 191 阅读 · 0 评论 -
spring boot + redis 实现session共享
spring boot + redis 实现session共享这次带来的是spring boot + redis 实现session共享的教程。 在spring boot的文档中,告诉我们添加@EnableRedisHttpSession来开启spring session支持,配置如下:Java代码 @Configurati转载 2017-11-01 21:53:31 · 473 阅读 · 0 评论 -
Spring Boot实战之导出excel
Spring Boot实战之导出excel本文使用Apache POI实现excel文档的导出。 实现从数据库读取数据——生成excel——上传到AzureStorage的流程数据库操作,及文件上传AzureStorage的流程可以参考之前的文章http://blog.csdn.net/sun_t89/article/details/51912905http:/转载 2017-09-22 22:28:04 · 15286 阅读 · 3 评论