
springboot
xinyuebaihe
这个作者很懒,什么都没留下…
展开
-
themeleaf
<p th:text="'Hello!, ' + ${name} + '!'">3333</p><div th:object="${session.user}"> <p>Name: <span th:text="*{firstName}">Sebastian</span>原创 2019-01-29 15:46:23 · 551 阅读 · 0 评论 -
@GetMapping与@PostMapping区别
@GetMapping是一个组合注解,是@RequestMapping(method = RequestMethod.GET)的缩写。@PostMapping是一个组合注解,是@RequestMapping(method = RequestMethod.POST)的缩写。如果地址路径一样,只是一个是get请求,一个是post请求,则后台不会报错,且会指向正确的接收方法。https://...原创 2019-01-29 16:50:56 · 5629 阅读 · 0 评论 -
springboot 配置文件
package com.kelly.controller;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.EnableAutoConfiguration;import org.springframework.context.annotation....转载 2019-01-29 19:33:34 · 149 阅读 · 0 评论 -
SpringBoot - 配置文件加载位置与优先级
项目内部配置文件spring boot 启动会扫描以下位置的application.properties或者application.yml文件作为Spring boot的默认配置文件–file:./config/–file:./–classpath:/config/–classpath:/以上是按照优先级从高到低的顺序,所有位置的文件都会被加载,高优先级配置内容会覆盖低优先级配...转载 2019-01-29 19:51:55 · 159 阅读 · 0 评论 -
thymeleaf 判断空值及拼接字符串
1.拼接字符串。'/img/xx/'为固定路径,后面的可变<img id="img" th:src="@{'/img/xx/'+${a.b.c}}">2.if 判断<img id="img" th:src="@{'/img/xx/'+${a.b.c}}">如果a或者b为空,则会报500错。加判断为空有简略的写法.在每一个对象后加?,即在点前加?原创 2019-03-05 16:32:48 · 8247 阅读 · 1 评论 -
springboot 自定义异常及使用
https://baijiahao.baidu.com/s?id=1613899474131869768&wfr=spider&for=pc在Spring 3.2中,新增了@ControllerAdvice、@RestControllerAdvice 注解,用于定义@ExceptionHandler、@InitBinder、@ModelAttribute,并应用于@...转载 2019-03-06 20:24:02 · 804 阅读 · 0 评论