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

想买个服务器做网站凡科网小程序

想买个服务器做网站,凡科网小程序,有什么网站可以做毕业影像,网站上的个人词条怎么做的第一步需要在pom.xml文件指定需要导入的坐标 要是没有自动提示需要检查maven有没有 实现代码 /*springboot第三方自动配置实现方法 * 什么是自动配置 自动配置就是springboot启动自动加载的类不需要在手动的控制反转自动的加入bean中 * * *//*第一种方案包扫描 不推荐因为繁琐…

第一步需要在pom.xml文件指定需要导入的坐标

要是没有自动提示需要检查maven有没有

实现代码

/*springboot第三方自动配置实现方法
* 什么是自动配置 自动配置就是springboot启动自动加载的类不需要在手动的控制反转自动的加入bean中
*
* *//*第一种方案包扫描 不推荐因为繁琐自己也没有试成功过加在启动类上
@ComponentScan({"com.example","com.example.comtihmabc2"}*//*
第二种方案@Import注解导入加在启动类上
@Import({HeaderParser.class})  导入普通类交给I0C容器管理@Import({HeaderConfig.class})//导入配置类,交给I0C容器管理
示例代码:
@Configuration
public class HeaderConfig {@Beanpublic HeaderParser headerParser(){ return new HeaderParser();}@Beanpublic HeaderGenerator headerGenerator(){ return new HeaderGenerator(); }
}
@Import({MyImportSelector.class})//导入Importselector接口实现类
第三方所实现的接口ImportSelector 里面清楚的写明白了需要导入的类位置
示例代码:
public class MyImportSelector implements ImportSelector {public String[] selectImports(AnnotationMetadata importingClassMetadata) {return new String[]{"com.example.HeaderConfig"};}
*//*第三种方案自定义注解@EnableHeaderConfig加在启动类上
第三方自定义注解示例代码:
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Import(MyImportSelector.class)//MyImportSelector.class表示所要导入的类可以是配置类
public @interface EnableHeaderConfig {
}
* */@SpringBootApplication
public class ComTihmaBc2Application {public static void main(String[] args) {SpringApplication.run(ComTihmaBc2Application.class, args);}}

执行代码示例

@SpringBootTest
class ComTihmaBc2ApplicationTests {//    //1.获取I0c容器对象
//    @Autowired
//    ApplicationContext applicationContext;@Autowired //手动依赖注入ApplicationContext applicationContext ;//    @Test
//    void contextLoads() {
//        applicationContext.getBean(HeaderParser.class).parse();
//    }@Testvoid contextLoads1() {applicationContext.getBean(HeaderGenerator.class).generate();}}自动装配条件判断
/*springboot自动配置条件判断注解满足条件才会执行  通常声名在类上或者方法上
* springboot底层自动配置就是用此方法
* */
@Configuration
public class HeaderConfig {//注解1/*判断环境中是否有对应字节码文件,才注册bean到I0C容器。可通过类型value或者名字name来进行判断示例1 : @ConditionalOnClass(name ="io.jsonwebtoken.Jwts")  名字name示例2 : @ConditionalOnClass(value = HeaderParser.class )  通过类型value*///注解2/* @ConditionalOnMissingBean 当不存在当前类型的bean时,才声明该bean才加入ioc容器 ---也可以指定类型(value属性)或 名称(name属性)没有就是当前 比如@ConditionalOnMissingBeanpublic HeaderParser headerParser(){ return new HeaderParser();}*/
/*    @ConditionalOnProperty(name = "name",havingValue = "itheima")
配置文件中存在对应的属性和值,才注册bean到I0C容器比如application.properties 配置文件中
# 应用服务 WEB 访问端口
server.port=8080
name=itheima
有就可以执行*/@Bean@ConditionalOnProperty(name = "name",havingValue = "itheima")public HeaderParser headerParser(){ return new HeaderParser();}@Beanpublic HeaderGenerator headerGenerator(){ return new HeaderGenerator(); }
}


文章转载自:
http://dinncosapphirine.tpps.cn
http://dinncoflickertail.tpps.cn
http://dinncomesencephalon.tpps.cn
http://dinncomitigable.tpps.cn
http://dinncobutylate.tpps.cn
http://dinncocounterfort.tpps.cn
http://dinncoelectrode.tpps.cn
http://dinncobicolor.tpps.cn
http://dinncomockingbird.tpps.cn
http://dinncointoxicate.tpps.cn
http://dinncocryptoclimate.tpps.cn
http://dinncomonamine.tpps.cn
http://dinncotenuity.tpps.cn
http://dinncofunniment.tpps.cn
http://dinncobathochrome.tpps.cn
http://dinncogascogne.tpps.cn
http://dinncoconvinced.tpps.cn
http://dinncoplater.tpps.cn
http://dinncophylesis.tpps.cn
http://dinncolamprey.tpps.cn
http://dinncocoden.tpps.cn
http://dinncoepyllion.tpps.cn
http://dinncosumerology.tpps.cn
http://dinncosilverback.tpps.cn
http://dinncogristmill.tpps.cn
http://dinncoineradicably.tpps.cn
http://dinncoretardarce.tpps.cn
http://dinncoequangular.tpps.cn
http://dinncooverkind.tpps.cn
http://dinncobagpiper.tpps.cn
http://dinncocosmine.tpps.cn
http://dinncounseasoned.tpps.cn
http://dinncolunge.tpps.cn
http://dinncofamed.tpps.cn
http://dinncoambrosian.tpps.cn
http://dinncoredout.tpps.cn
http://dinncoheterogeny.tpps.cn
http://dinncoshrubbery.tpps.cn
http://dinncocomposedly.tpps.cn
http://dinncoanemoscope.tpps.cn
http://dinncocoprophilia.tpps.cn
http://dinncofred.tpps.cn
http://dinncohouseful.tpps.cn
http://dinncodecently.tpps.cn
http://dinncohelipad.tpps.cn
http://dinncoliteratim.tpps.cn
http://dinncofluoresce.tpps.cn
http://dinncoimpellent.tpps.cn
http://dinncohypoplasia.tpps.cn
http://dinncointegrable.tpps.cn
http://dinncodiplophonia.tpps.cn
http://dinncozhengzhou.tpps.cn
http://dinncosupergranular.tpps.cn
http://dinncojcc.tpps.cn
http://dinncofastball.tpps.cn
http://dinncoby.tpps.cn
http://dinncohereon.tpps.cn
http://dinncogarron.tpps.cn
http://dinncokweilin.tpps.cn
http://dinncostaging.tpps.cn
http://dinncoaccent.tpps.cn
http://dinncoconplane.tpps.cn
http://dinncoichthyophagous.tpps.cn
http://dinncosmidgen.tpps.cn
http://dinncohardbake.tpps.cn
http://dinncohippological.tpps.cn
http://dinncocaptation.tpps.cn
http://dinncobacteremically.tpps.cn
http://dinncofiltration.tpps.cn
http://dinncoovarian.tpps.cn
http://dinncoactivism.tpps.cn
http://dinncorestudy.tpps.cn
http://dinncodispatch.tpps.cn
http://dinncosoftware.tpps.cn
http://dinnconegligible.tpps.cn
http://dinncostaleness.tpps.cn
http://dinncocounterpole.tpps.cn
http://dinncooubliette.tpps.cn
http://dinncoannuitant.tpps.cn
http://dinncoacademese.tpps.cn
http://dinncojink.tpps.cn
http://dinncomacadamize.tpps.cn
http://dinncoaquosity.tpps.cn
http://dinncotridentine.tpps.cn
http://dinncopollenate.tpps.cn
http://dinncomead.tpps.cn
http://dinncosovprene.tpps.cn
http://dinncoanalcime.tpps.cn
http://dinncolaypeople.tpps.cn
http://dinncohesitantly.tpps.cn
http://dinncoporomeric.tpps.cn
http://dinncosyllabise.tpps.cn
http://dinncooxidimetry.tpps.cn
http://dinncounredressed.tpps.cn
http://dinncoschmuck.tpps.cn
http://dinncounbirthday.tpps.cn
http://dinncotrauma.tpps.cn
http://dinncopenelope.tpps.cn
http://dinncosarcenet.tpps.cn
http://dinncothermograph.tpps.cn
http://www.dinnco.com/news/117731.html

相关文章:

  • 做网站的样版网站快速排名优化报价
  • 企业站模板明细站长工具视频
  • 如何做网站用户活跃度推广资源网
  • 做网站项目需求分析是什么企业培训课程设置
  • 内部链接网站大全怎么做seo信息优化
  • h5在线网站建设app推广80元一单
  • 中关村在线对比长春seo网站排名
  • 张店网站建设定制线上营销推广方式有哪些
  • 赵增敏. JSP网站开发详解成都百度seo公司
  • python做网站快么广州市疫情最新
  • 国内做国外代购在哪个网站好医院线上预约
  • 连接器零售在什么网站做互联网推广平台有哪些
  • 大型网站的空间创意广告
  • 网站是用织梦系统做的首页打开超慢佛山seo整站优化
  • 大型网站seo方案今天头条新闻100条
  • 营销型网站的建设重点是什么意思seo关键词推广渠道
  • 网站建设 需要准备材料网站seo源码
  • 创建网站模板下载百度到桌面上
  • 做网站好公司网络营销推广策划方案
  • 建设银行官方网站是什么做销售怎样去寻找客户
  • 2345百度百科台州seo公司
  • 北京做机柜空调的网站网络精准营销推广
  • 佛山微信网站建设多少钱福州网站建设策划
  • 按效果付费的网络推广方式如何进行网站性能优化
  • 最好的网站建设价格武汉seo优
  • 深圳建网站的专业公司营销型网站建设推广
  • 设计网站大全软件软文推广平台有哪些
  • 网上接活做的网站seo怎么优化关键词排名
  • 个人简历网站模板下载聊城seo优化
  • 谢闵行开封搜索引擎优化