SpringBoot
同猿人
hello 我的
展开
-
springboot连接MySQL报错--The elements [spring.datasource.schema[0].classpath] were left unbound
报错内容:***************************APPLICATION FAILED TO START***************************Description:Binding to target [Bindable@682c1e93 type = java.util.List<java.lang.String>, value = ...原创 2019-12-10 15:20:16 · 2035 阅读 · 0 评论 -
使用spring boot配置文件连接docker上的mysql所报异常
报错信息:java.sql.SQLException: Access denied for user ‘’@‘192.168.220.1’ (using password: NO)解决方法:即:spring: datasource: username: root password: abc123 url: jdbc:mysql://192.168...原创 2019-12-10 14:35:45 · 832 阅读 · 0 评论 -
IDEA创建一个spring boot的web项目
maven依赖地址:https://mvnrepository.com/方式一:maven方式一、File -> New -> Project二、maven骨架,就是帮助我们新建好了一些文件,可以省去这一步,具体请看后面三、四、方式二、Spring Initializr两种方式的主要区别在pom.xml文...原创 2019-12-08 19:55:09 · 777 阅读 · 1 评论 -
Spring Boot2.0以上版本EmbeddedServletContainerCustomizer被WebServerFactoryCustomizer替代
spring boot嵌入式servlet容器的问题今天学到spring boot嵌入式servlet容器的时候发现EmbeddedServletContainerCustomizer不可用,随后度娘找发现在Spring Boot2.0以上配置嵌入式Servlet容器时EmbeddedServletContainerCustomizer类不存在,而且已经被WebServerFactoryCu...原创 2019-12-08 18:07:12 · 971 阅读 · 0 评论 -
thyme leaf页面修改以后实时生效的方式
方式一、禁用掉thyme leaf模板引擎的缓存,在application.properties配置文件中加入如下代码spring.thymeleaf.cache=false方式二、页面修改完成之后按CTRL+F9:重新编译如此方便快捷节省时间,...原创 2019-12-07 13:44:58 · 840 阅读 · 0 评论 -
springboot国际化乱码
界面如图:解决方法一、配置idea的编码格式,主要是配置项目的编码解决方法一、application.properties配置文件spring.messages.encoding=utf-8spring.messages.basename=i18n.login...原创 2019-12-07 13:27:32 · 1304 阅读 · 1 评论 -
spring boot 2.0 WebMvcConfigurerAdapter 方法过时的解决方法
如果我们使用Spring 5.xx(或者Spring Boot 2.xx)版本来构建或者升级应用程序,在配置WebMvc时,则会出现此警告,这是因为在早期的Spring版本中,如果要配置Web应用程序,可以通过扩展WebMvcConfigurerAdapter类快熟实现配置@Configurationpublic class OldMvcConfig extends WebMvcConfi...转载 2019-12-06 21:32:31 · 1613 阅读 · 0 评论 -
Spring Boot:无法访问本地主机上的REST控制器(404)?
配置没问题,也不是thymeleaf的问题,因为文件位置放错了,细节问题,一定要看清楚文件的位置有两种方法可以解决这个问题方法1)将启动应用程序放置在包结构的开始位置,并将其中的所有控制器放置在其中。示例:package com.spring.boot.app; - 你启动应用程序(即主要方法-SpringApplication.run(App.class,args);)你在R...原创 2019-12-06 15:21:07 · 757 阅读 · 0 评论