当前位置: 首页 > news >正文

广州建筑公司网站wordpress忘记用户名密码

广州建筑公司网站,wordpress忘记用户名密码,汉化主题 wordpress,国内免费图片素材网站starter1. target2. 手写启动器~2.1 自动装配#xff0c;自定义属性2.2 启动器#xff0c;引用自动装配模块3. 在自己的项目引用上面的starter1. target 1. 启动器只用来做依赖导入(导入配置模块)2. 专门来写一个自动配置模块3. 启动器依赖自动配置#xff1b;别人只需要引入… starter1. target2. 手写启动器~2.1 自动装配自定义属性2.2 启动器引用自动装配模块3. 在自己的项目引用上面的starter1. target 1. 启动器只用来做依赖导入(导入配置模块)2. 专门来写一个自动配置模块3. 启动器依赖自动配置别人只需要引入启动器starterxxx-spring-boot-starter; 自定义启动器名分析 一个启动器需要两个模块一个是自动装配模块自动装配属性定义好装配规则。 第二个是启动器引用自动配置模块。 将两个项目打包到maven仓库或者私服仓库 自己的其它项目引用启动器就行了 在yaml或者properties中配置好启动器的属性就行了。需要的注解 Configuration 指定这是一个配置类ConditionalOnXXX 指定条件成立下自动配置类生效AutoConfigureAfter 指定自动配置的顺序Bean 给容器中添加组件ConfigurationProperites 结合xxxProperties 类绑定相关的配置EnableConfigurationProperties // 让xxxProperties生效加入容器中自动配置类如何能加载将需要启动就加载的自动配置类配置在META-INF/spring.properteis 中2. 手写启动器~ 2.1 自动装配自定义属性 自动配置pom只留下下面的依赖 ?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersionparentgroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-parent/artifactIdversion2.3.4.RELEASE/versionrelativePath/ /parent!-- 自动配置模块... --groupIdcn.bitqian/groupIdartifactIdbitqian-spring-boot-starter-autoconfigurer/artifactIdversion0.0.1-SNAPSHOT/versionnamebitqian-spring-boot-starter-autoconfigurer/namedescriptionDemo project for Spring Boot/descriptionpropertiesjava.version1.8/java.version/propertiesdependenciesdependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter/artifactId/dependency/dependencies/project 启动器的属性boot中常见的xxxProperties类 package cn.bitqian.starter;import org.springframework.boot.context.properties.ConfigurationProperties;ConfigurationProperties(prefix bitqian.hello) // 配置别名 public class HelloProperties {/*** 可以配置的属性前缀*/private String prefix;/*** 可以自动装配的属性后缀*/private String suffix;public String getPrefix() {return prefix;}public void setPrefix(String prefix) {this.prefix prefix;}public String getSuffix() {return suffix;}public void setSuffix(String suffix) {this.suffix suffix;} } 启动器功能方法 package cn.bitqian.starter;/*** author echo lovely* date 2020/11/8 11:39*/ public class HelloService {private HelloProperties helloProperties;public HelloProperties getHelloProperties() {return helloProperties;}public void setHelloProperties(HelloProperties helloProperties) {this.helloProperties helloProperties;}/*** 启动器的方法配置前后缀实现sayHello* param name parameter* return string*/public String sayHello(String name) {return helloProperties.getPrefix() name helloProperties.getSuffix();}} 自动装配类 package cn.bitqian.starter;import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration;// 配置类 Configuration ConditionalOnWebApplication // web应用才能生效 EnableConfigurationProperties(HelloProperties.class) // 让属性文件生效 public class HelloServiceAutoConfiguration {Autowiredprivate HelloProperties helloProperties;Beanpublic HelloService helloService() {HelloService helloService new HelloService();helloService.setHelloProperties(helloProperties);return helloService;}} 创建META-INF文件夹配置自动装配类在spring.factories里面 # Auto Configure org.springframework.boot.autoconfigure.EnableAutoConfiguration\ cn.bitqian.starter.HelloServiceAutoConfiguration 双击安装到maven仓库 2.2 启动器引用自动装配模块 启动器模块依赖自动配置模块 ?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apache.org/POM/4.0.0xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersion!-- 启动器 --groupIdcn.bitqian/groupIdartifactIdbitqian-spring-boot-starter/artifactIdversion1.0-SNAPSHOT/version!-- bitqian springboot 启动器依赖导入 --dependenciesdependencygroupIdcn.bitqian/groupIdartifactIdbitqian-spring-boot-starter-autoconfigurer/artifactIdversion0.0.1-SNAPSHOT/version/dependency/dependencies/project 安装到maven仓库 3. 在自己的项目引用上面的starter 创建springboot项目引入依赖 编写controller package cn.bitqian;import cn.bitqian.starter.HelloService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController;RestController public class DemoController {AutowiredHelloService helloService;RequestMapping(/hello)public String hello() {return hello, helloService.sayHello( rye );}} 自动装配, 嘤嘤嘤 bitqian.hello.prefixi like bitqian.hello.suffixso much so- - -
http://www.zqtcl.cn/news/91231/

相关文章:

  • 怎样打开网站制作千图app的优势
  • 网站建设销售经理职责大桥石化集团网站谁做的
  • 黄金网站软件免费靖江seo快速排名
  • 网站建设经验做法和取得的成效wordpress 浏览器兼容
  • 代理记账注册公司图片商丘网站seo
  • 北京网站建设推荐安徽秒搜科技河南建设工程信息网招标公告
  • 网站开发项目实训总结微网站设计
  • 山东济南建网站公司东莞排名seo网站关键词优化
  • 找网站建设企业培训机构哪家最好
  • 建什么类型个人网站比较好开发高端网站建设价格
  • 网站开发 卡片网站建设合同需要印花税
  • 手机端网站图片上传如何做新公司取名字大全免费
  • vue.js网站建设智慧团建官方网站登录入口
  • 江宁区建设局网站网站建设 美食站点
  • 哈尔滨松北区建设局网站唐山企业网站模板建站
  • 服装公司网站策划书外网设计灵感网站
  • 学做婴儿衣服网站windows 建网站
  • 银饰品网站建设规划策划书wordpress近义词搜索
  • 淘宝联盟网站推广位怎么做网站开发合同支付
  • 有没有一些有试卷做的网站ios开发教程
  • 网站备案服务类型红酒公司网站源码
  • 南宁网站优化推广方案4000套微信小游戏源码
  • 什么犁网站做淘宝门头阿里云 wordpress建站
  • 免费网站建设凡科设计师的网站有哪些
  • 微信公众号运营方法seo 排名 优化
  • 深圳做营销网站设计淘宝网官方网站免费下载
  • 菏泽住房和城乡建设厅网站企业查询官网免费查询一下
  • 青海网站建设公司电话163 com邮箱注册
  • 建设法律法规文本查询网站自由设计师是什么意思
  • 分站城市网站如何做seo上海网站建设选缘魁