使用组件注册方式整合Servlet
摘要:package com.itheima.servletComponent; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import
阅读全文
自定义拦截器完成页面自动跳转和页面内容动态展示
摘要:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
访问URL路径映射
摘要:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
Spring Boot thymeleaf视图以及国际化语言转换
摘要:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
Spring Boot整合 Redis
摘要:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
解决:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
摘要:这是因为我同时添加了JPA和Redis依赖,可能是里面有相同的自动加载数据源配置类导致; 处理方法一:把JPA和Redis依赖去掉其中一个就可以了。 处理方法二:在启动类的注解加上下面的语句就可以了。 @SpringBootApplication(exclude = DataSourceAutoCo
阅读全文
Spring Boot整合JPA
摘要:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
使用配置文件XML的方式整合Mybatis
摘要:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
使用注解的方式整合MyBatis
摘要:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
配置文件随机值设置以及参数间引用
摘要:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
使用@Profile注解进行多环境函数设计
摘要:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
使用Profile文件进行多环境配置
摘要:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
使用@Configuration编写自定义配置类
摘要:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
使用@ImportResource加载XML配置文件设置的Bean
摘要:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
使用@PropertySource加载自定义配置文件
摘要:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
读取application.properties参数注入到Bean属性
摘要:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
解决:ApplicationTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration
摘要:这是在运行测试类的时候提示报错信息; 原因是没有把启动类写好或者是没有配置启动类; 解决如下, 先是要正常写好启动类; 然后把启动类添加到运行的测试类,添加到这个地方:@SpringBootTest; 有两种填写方式,一种是:@SpringBootTest(webEnvironment = Spri
阅读全文
解决:The annotation @Autowired is disallowed for this location
摘要:解决方案: 自动装配的语法要求:不允许在局部进行自动装配(即:只能写在method外class里)。 自动装配的动作都是在容器启动的时候,容器在读取配置文件和加载类的时候就需要进行装配了,如果将它放在方法内,它就成了局部的信息,对外是不可见的,无法进行装配,必须是成员变量,这样在加载的时候容器才检测
阅读全文
解决:Closing JPA EntityManagerFactory for persistence unit 'default'
摘要:运行代码出现这个报错,是因为配置pom.xml依赖包的时候,忘记了加入下面的依赖;把这个依赖加上后,再重新启动应用就可以了。 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starte
阅读全文