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

网站建设验收使用情况手机怎样做刷赞网站

网站建设验收使用情况,手机怎样做刷赞网站,珠海网站建设公司怎么样,制作手机广告的网站003讲到了导入jar包中的方法#xff0c;但其实是个半成品#xff0c;别人写的jar包中的方法我要在自己的代码中去调用#xff0c;非常的不方便。原则上写给别人用的jar包#xff0c;人家要能直接用#xff0c;而不用写注入的方法。 在springboot中会自动扫描imports文件中…003讲到了导入jar包中的方法但其实是个半成品别人写的jar包中的方法我要在自己的代码中去调用非常的不方便。原则上写给别人用的jar包人家要能直接用而不用写注入的方法。 在springboot中会自动扫描imports文件中的内容利用这一点进行自动注入的开发 以下是整个jar包的目录 Country // // Source code recreated from a .class file by IntelliJ IDEA // (powered by FernFlower decompiler) //package cn.itcast.pojo;public class Country {private String name;private String system;public Country() {}public Country(String name, String system) {this.name name;this.system system;}public String getName() {return this.name;}public void setName(String name) {this.name name;}public String getSystem() {return this.system;}public void setSystem(String system) {this.system system;}public String toString() {return Country{name this.name , system this.system };} }Province // // Source code recreated from a .class file by IntelliJ IDEA // (powered by FernFlower decompiler) //package cn.itcast.pojo;public class Province {private String name;private String direction;public Province() {}public Province(String name, String direction) {this.name name;this.direction direction;}public String getName() {return this.name;}public void setName(String name) {this.name name;}public String getDirection() {return this.direction;}public void setDirection(String direction) {this.direction direction;}public String toString() {return Province{name this.name , direction this.direction };} }CommonConfig // // Source code recreated from a .class file by IntelliJ IDEA // (powered by FernFlower decompiler) //package cn.itcast.config;import cn.itcast.pojo.Country; import cn.itcast.pojo.Province; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean;public class CommonConfig {public CommonConfig() {}ConditionalOnProperty(prefix country,name {name, system})Beanpublic Country country(Value(${country.name}) String name, Value(${country.system}) String system) {return new Country(name, system);}Beanpublic Province province() {return new Province();} }CommonAutoConfig // // Source code recreated from a .class file by IntelliJ IDEA // (powered by FernFlower decompiler) //package cn.itcast.config;import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.Import;AutoConfiguration Import({CommonConfig.class}) public class CommonAutoConfig {public CommonAutoConfig() {} }xxx.imports cn.itcast.config.CommonAutoConfig 以上封装好的jar包就能自动注入了 接着在工程中引用 package com.geji;import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ApplicationContext;/*** Hello world!**/ SpringBootApplication public class SpringbootAutoConfigApplication {public static void main( String[] args ){ApplicationContext context SpringApplication.run(SpringbootAutoConfigApplication.class,args);System.out.println(context.getBean(dispatcherServlet));System.out.println(context.getBean(province));} }以上是自动配置功能项目中也能用了但是在实际工作中会更进一步编写starter用来实现依赖管理功能这样的话给别人用的时候就更方便了 创建两个maven工程dmybatis-spring-boot-aotuconfiguredmybatis-spring-boot-starter dmybatis-spring-boot-aotuconfigure无所谓的跟上半篇一模一样 在dmybatis-spring-boot-aotuconfigure编写Porn.xml 在dmybatis-spring-boot-aotuconfigure编写自动配置类 编写可以给spring自动扫描的配置文件 以下文件没用到删了 dmybatis-spring-boot-starter引入dmybatis-spring-boot-aotuconfigure和dmybatis-spring-boot-aotuconfigure本身引入的其他包 dmybatis-spring-boot-starter只是个依赖管理删除其他文件 以上就完成了这样就能在其他项目中直接引入了
http://www.zqtcl.cn/news/123601/

相关文章:

  • 网站建设哪里学成品短视频app源码搭建
  • 网站可以自己做温州制作手机网站
  • 根河企业网站建设房地产如何做网站推广
  • 东莞个人网站建设南宁网站制作公
  • 网站推广seo是什么上海市人力资源网官网
  • 玉溪做网站的公司delphi xe10网站开发
  • 使用vue做的网站有哪些企业门为什么要建设门户网站
  • 上海移动云网站建设在门户网站上爆光怎么做
  • 网站建设开票内容百度浏览器广告怎么投放
  • 深圳公司网站建立小程序商店制作
  • 网站建设知识网犀牛云做网站多少钱
  • 东莞seo优化推广重庆做网络优化公司电话
  • 网站建设的设计思路高校建设网站的特色
  • 宁波网站建设八宝山做网站的公司
  • 哪里有网站建设多少钱网站建设哪家服务态度好
  • 白云区网站开发公司备案不关闭网站的方法
  • 男的做那个视频网站家用电脑可以做网站服务器
  • 网站建设的行业客户烟台市未成年思想道德建设网站
  • 设计个网站要多少钱鼓楼网站开发
  • 东莞外贸网站搭建制作北京app开发制作
  • 优化网站公司外包微信商城怎么开店
  • 网站设计的导航栏怎么做东莞seo网络优化
  • wordpress直接上传视频网站吗做网站软件
  • 电脑维修网站模板下载来个网站吧好人一生平安2021
  • 做公益选哪个网站好网站建设方案多少钱
  • 丰台做网站的公司vs2015 手机网站开发
  • 宝思哲手表网站qq官网登录入口网页版
  • 二手书网站开发设计太原建设网站的公司
  • 江门网站seo推广qq代挂网站建设
  • 合肥制作网站企业做文字logo的网站