1、问题复现: 之前在SpringBoot中配置整合了log4j2,今天在pom文件中,导入新的依赖(依赖如下)之后, <dependency> <groupId>com.github.tobato</groupId> <artifactId>fastdfs-client</artifactId> ...
分类:
编程语言 时间:
2019-12-17 15:20:51
阅读次数:
200
导入依赖: Developer tools are automatically disabled when running a fully packaged application. If your application is launched from java -jar or if it is ...
分类:
编程语言 时间:
2019-12-17 14:47:48
阅读次数:
218
这个在jsp中很容易实现,但是springBoot不推荐使用jsp,建议使用thymeleaf,下面是在thymeleaf中引入界面的方法 1.修改配置文件 spring: mvc: static-path-pattern: /static/** thymeleaf: prefix: classpa ...
分类:
其他好文 时间:
2019-12-16 22:06:05
阅读次数:
374
项目是SpringCloud框架,分布式项目,包括Eureka、Zuul、Config、User-Svr(用户管理的服务,既是服务端也是客户端); SpringCloud框架的SpringBoot 的项目搭建就不再赘述,这里重点介绍如何引入集成 Shiro 框架: Apache Shiro是一个强大 ...
分类:
编程语言 时间:
2019-12-16 20:53:28
阅读次数:
107
有时在使用idea通过Spring Initailizr创建项目时,默认只能创建最近的版本的SpringBoot项目。 这是如果想要换成版本,就可以在项目创建好了之后,在pom文件中直接将版本修改过来。 如下所示 比如在创建项目时默认的版本为2.2.2版本: <parent> <groupId>or ...
分类:
编程语言 时间:
2019-12-16 17:46:18
阅读次数:
417
@Configurationpublic class CrossConfig implements WebMvcConfigurer { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMappin ...
分类:
编程语言 时间:
2019-12-16 15:02:15
阅读次数:
96
/** 1、书写一个名为resources/application.properties的属性文件 >书写一个配置属性类,类名为: **/ 文件:application.properties jdbc.driverClassName=com.mysql.jdbc.Driverjdbc.url=jdb ...
分类:
编程语言 时间:
2019-12-16 14:50:08
阅读次数:
117
前面的Springboot整合jdbcTemplate、mybatis、jpa三篇文章中使用的数据库连接池都是Spingboot默认配置的tomcat.jdbc.pool。配置原理进入org.springframework.boot.autoconfigure.jdbc.DataSourceConf... ...
分类:
编程语言 时间:
2019-12-16 13:28:16
阅读次数:
110
创建httpClientConfig配置类 @Configuration @PropertySource(value="classpath:/properties/httpClient.properties") public class HttpClientConfig { @Value("${ht ...
分类:
编程语言 时间:
2019-12-16 13:17:57
阅读次数:
94
java -jar demo-0.0.1-SNAPSHOT.jar 常驻进程 nohup java -jar demo-0.0.1-SNAPSHOT.jar & nohup的意思不挂服务,常驻的意思,除非云服务器重启,那就没法了;最后一个&表示执行命令后要生成日志文件nohup.out 这样就不担心 ...
分类:
编程语言 时间:
2019-12-16 10:05:15
阅读次数:
94