springboot
Lov_sb
加油吧!!!搬砖工!!!
展开
-
freemarker/html转pdf
一天总有些无语的需求,人都要裂了,本来是word转pdf,但是因为要先在页面显示,再导出,而且页面排版很麻烦,果断选择用模板,比用word或直接写odf快多了1、读取模板并转为字符串spring.freemarker.template-loader-path=classpath:ftlspring.freemarker.suffix=.ftlspring.freemarker.charse...原创 2019-12-03 00:28:28 · 603 阅读 · 0 评论 -
freemarker 定义字符串为模板
import freemarker.cache.StringTemplateLoader;import freemarker.template.Configuration;import freemarker.template.Template;import freemarker.template.TemplateException;import org.apache.commons.lan...原创 2019-12-03 00:10:48 · 391 阅读 · 1 评论 -
spring-security 手动验证登录 —— springboot
适用于某个操作,需要用户验证,可手动调用登录验证1、注入AuthenticationManagerspringboot2.0好像没有自动注入了,需要手动注入@EnableWebSecurity@EnableConfigurationProperties(SecurityConfigProperty.class)public class SecurityConfig extends W...原创 2019-12-02 23:34:36 · 618 阅读 · 0 评论 -
请求参数过滤器 (去请求参数前后空格)—— springboot
1、ParameterRequestWrapperimport cn.com.app.plugins.generator.util.StringUtils;import com.alibaba.fastjson.JSON;import org.apache.commons.io.IOUtils;import org.springframework.http.HttpHeaders;imp...原创 2019-12-02 23:23:00 · 1804 阅读 · 0 评论 -
Controller、Service日志切面 —— springboot
1、maven <!-- aop --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId>...原创 2019-12-02 23:08:36 · 877 阅读 · 0 评论