![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
springboot
雪儿waii
https://m.gitee.com/wangxuewaii
展开
-
thymeleaf显示图片
thymeleaf显示图片 @RequestMapping(value="/text") public String text(Model model){ Product product = new Product(); product.setProductId(1); product.setPr原创 2018-02-06 12:49:51 · 45519 阅读 · 4 评论 -
springboot—配置详解
1 自定义属性值,并取出,相当于以前的properties文件,并从里面取出数据示例:在application.yml文件里定义,以取size里的数值为例server: port: 8089size: 6666 然后在类中取出size的数值@RestControllerpublic class hello { @Value("${size}"...原创 2018-02-15 13:31:30 · 265 阅读 · 0 评论 -
spring-data-jpa的使用
1.先在pom xml文件中加入以下依赖 如果一下子没反应过来,可以右键刷新pom文件<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId&g...原创 2018-02-15 20:02:26 · 199 阅读 · 0 评论 -
springboot表单验证,aop
1 表单验证例如:未满18岁的少女不能让信息写入数据库关键:@Min(value=18,message=”未成年少女不得入内”) private Integer age;@Entity //实体类注解public class girl { @Id //主键 @GeneratedValue //自增 private Integer id; ...原创 2018-02-16 14:56:52 · 316 阅读 · 0 评论 -
跨域问题
1 什么是跨域 从前台调用后台服务接口时,如果这个接口不是同一个域的,就会产生跨域问题。题外小知识: 2 跨域访问安全问题服务器端:package com.example.demo;import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.annotation.Re原创 2018-02-16 21:41:10 · 374 阅读 · 0 评论 -
springboot security
这次用的是gradle管理工具1 引入依赖不分啦,我就全拷过来吧,底下注释的挺清楚的啦~// buildscript 代码块中脚本优先执行buildscript { // ext 用于定义动态属性 ext { springBootVersion = '1.5.2.RELEASE' } // 自定义 Thymeleaf 和 Thym...原创 2018-02-18 11:12:47 · 218 阅读 · 0 评论 -
API网关和springboot 的filter展示
1springboot中过滤器先自定义filter继承javax.servlet.Filterpackage com.wx.house.filter;import java.io.IOException;import javax.servlet.Filter;import javax.servlet.FilterChain;import javax.servlet.Filter...原创 2018-02-22 10:25:30 · 1446 阅读 · 0 评论 -
将springboot的pom中的maven继承改为引入,内嵌jetty
参考文档:https://docs.spring.io/spring-boot/docs/1.5.4.RELEASE/reference/htmlsingle/#using-boot-maven-without-a-parent将springboot的pom中的maven继承改为引入1,注释掉原来自动创建的springboot parent如下:<!-- <parent...原创 2018-02-23 11:16:02 · 834 阅读 · 1 评论