1微驶、org.xml.sax.SAXParseException: 元素類型 "meta" 必須由匹配的結(jié)束標(biāo)記 "" 終止蒸其。
解決辦法:頁面標(biāo)簽少了結(jié)束標(biāo)簽
2、Spring-JPA更新對(duì)象信息方法:
數(shù)據(jù)庫查詢出對(duì)象字柠,copy對(duì)象绑榴,過濾需要修改的字段"name","code","stateTime"
BeanUtils.copyProperties(roleService.findRoleById(role.getId()), role,
"name","code","stateTime”);
3.Error resolving template “home”, template might not exist or might not be accessible by any of the configured Template Resolvers
問題說明:不存在home文件或目錄配置錯(cuò)誤
解決辦法:需要?jiǎng)?chuàng)建一個(gè)html頁面名叫home.html;或配置路徑
spring:
? thymeleaf:
? ? cache:true
? ? prefix:classpath:/templates/
? ? mode:HTML5
4. nested exception is java.lang.IllegalArgumentException: No session repository could be auto-configured, check your configuration (session store type is 'null’)
edit? configuration中
name填寫:spring.profiles.active
value填寫:local
5.restTemplate 報(bào)錯(cuò) No instances available for ip
解決辦法:訪問ip:Create a new RestTemplate instead of autowiring it.
重新new一個(gè)RestTemplate對(duì)象實(shí)例
6.Spring-Boot無限自動(dòng)重啟
解決辦法:刪除方法spring-boot-devtools-1.5.1.RELEASE.jar
7.跨域問題
在Controller上面添加注解@CrossOrigin蹂午,就能提供跨域請求
import org.springframework.web.bind.annotation.CrossOrigin;
8.無法識(shí)別以POST方式請求的body數(shù)據(jù)
在Controller或者方法上的RequestMapping注解上加上字段consumes栏豺,則可支持body提交
consumes= MediaType.APPLICATION_JSON_VALUE
MediaType類名全路徑:org.springframework.http.MediaType