• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






天生自然

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 276 下一页

2022年3月4日

自定义Starters
摘要: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:sc 阅读全文
posted @ 2022-03-04 23:45 吴裕雄 阅读(35) 评论(0) 推荐(0)
 
解决:No active profile set, falling back to default profiles: default
摘要: pom.xml加上下面依赖: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> 阅读全文
posted @ 2022-03-04 23:27 吴裕雄 阅读(106) 评论(0) 推荐(0)
 
@Conditional根据满足某特定条件创建特定的Bean
摘要: package com.tszr.conditional; import org.springframework.context.annotation.Condition; import org.springframework.context.annotation.ConditionContext; 阅读全文
posted @ 2022-03-04 20:48 吴裕雄 阅读(70) 评论(0) 推荐(0)
 
配置和输出日志
摘要: #设定日志的默认级别为info logging.level.root=info #设定org包下的日志级别为warn logging.level.org=warn #设定com.ch.ch4_1包下的日志级别为debug logging.level.com.ch.ch4_1=debug loggin 阅读全文
posted @ 2022-03-04 19:59 吴裕雄 阅读(45) 评论(0) 推荐(0)
 
使用@PropertySource和@Value读取其它自定义的参数文件里面的参数值
摘要: package com.tszr.controller; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.PropertySource; 阅读全文
posted @ 2022-03-04 19:51 吴裕雄 阅读(61) 评论(0) 推荐(0)
 
使用@ConfigurationProperties读取application.properties参数
摘要: package com.tszr.model; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; @ 阅读全文
posted @ 2022-03-04 19:44 吴裕雄 阅读(94) 评论(0) 推荐(0)
 
@RequestMapping 转发数据乱码解决方案
摘要: @RequestMapping(value = "XXXX", method = RequestMethod.GET, produces = "text/html;charset=UTF-8") 添加produce部分 阅读全文
posted @ 2022-03-04 19:41 吴裕雄 阅读(118) 评论(0) 推荐(0)
 
使用@Value给属性参数赋值
摘要: package com.tszr.controller; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.RequestMapping; 阅读全文
posted @ 2022-03-04 19:23 吴裕雄 阅读(145) 评论(0) 推荐(0)
 
使用Environment直接读取application.properties参数
摘要: package com.tszr.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import or 阅读全文
posted @ 2022-03-04 19:11 吴裕雄 阅读(240) 评论(0) 推荐(0)
 
Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean
摘要: 在Spring Boot项目中,出现这个错误有两种情况: 一,在main方法所在的类忘记添加@SpringBootApplication 二,缺少依赖,添加即可 <dependency> <groupId>org.springframework.boot</groupId> <artifactId> 阅读全文
posted @ 2022-03-04 18:12 吴裕雄 阅读(929) 评论(0) 推荐(0)
 
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 276 下一页