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

芜湖城建集团公司要做seo

芜湖城建集团,公司要做seo,国内外基于vue框架的网站建设现状,网站域名备案与不备案的区别配置文件的介绍 配置文件当中记录了许多重要的配置信息,例如: 数据库的连接信息(用户的账户与密码)项目的启动端口第三方系统的调用密匙用于记录问题产生的日志 在spring框架中一些特定的框架会自动调用配置文件中的配置信息来运用. 配置文件中的属性也起到了类似全局变量的…

配置文件的介绍

配置文件当中记录了许多重要的配置信息,例如:

  • 数据库的连接信息(用户的账户与密码)
  • 项目的启动端口
  • 第三方系统的调用密匙
  • 用于记录问题产生的日志

在spring框架中一些特定的框架会自动调用配置文件中的配置信息来运用.

配置文件中的属性也起到了类似全局变量的作用. 

对于一个项目,可以准备多种配置文件方便自由调用来应对不同的情况.

放置在resources目录下 

配置文件的格式

Spring Boot的配置文件的格式主要有两种:

  • .properties(spring boot默认)
  • .yml

properties与yml都是配置文件,类似于同一件实物来说,properties是旧版的而yml是新版的.

properties与yml的优先级

properties与yml可以出现在同一个项目当中,还是建议在一个项目下使用同一种类型的配置文件.

但properties的优先级会更高,项目先加载properties中的配置,在这之后才去加载yml的.

 下面来示范一下.

①在同一个项目中分别放置properties与yml的配置文件

②分别在两种配置文件中配置同一属性的信息

yml配置的端口号为:666

properties配置的端口号为:123 

③在类中调用并打印查看结果

观察得到,打印的端口号为123,即是properties配置文件中的信息. 

注意,虽然properties配置文件在SpringBoot的优先级更高.但并不表示不会载入yml的信息噢,只是在同一个属性上优先使用properties中的信息. 

properties配置文件的说明 

properties是配置文件的早期文件类型,是spring boot的默认配置文件类型

基本语法

在properties是以键值对的方式来赋值,其中key与value是以"="来连接.

server.port = 123
#使用"#"在配置文件中进行注释

读取配置文件信息

在项目中想实现配置文件中内容的读取,可以使用@Value注解来实现

其中@Value注解的格式为${}

@Value("${server.port}")

缺点分析

当在配置相近的内容时,会额外的产生冗余的信息.

yml配置文件的说明

yml是yaml的缩写,全称为:Yet Another Markup Language(另一种标记语言).

对于properties来说,yml支持了更多的编程语言.还支持更多的数据类型,它可以简单表达清单(数组)、散列表,标量等数据形态。它使⽤空⽩符号缩进和⼤量依赖外观的特⾊,特别适合⽤来表达或编辑数据结构、各种配置⽂件.

基本语法 

yml的语法与JSON差不多,但yml使用":" + "(空格)"的形式组合连接key与value,其中的空格不要省略噢.

server.port: 666

对比: 

使用

①与properties对比

左边为yml,右边为properties.

可以观察到yml中的书写更为简便一些. 

②配置数据类型

yml还可以配置数据类型以及null(properties不可配置数据类型噢~)

 ③配置对象

写法一:

写法二:

配置文件中对象的读取

 对于yml中的对象就不能使用@Value来读取了

而是使用@ConfigurationProperties.

@ConfigurationProperties(prefix = "student1")//student1为yml中对象名称
@Component
public class Student {private int age;private String name;private String id;//其中getter与setter方法不能省略public int getAge() {return age;}public void setAge(int age) {this.age = age;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getId() {return id;}public void setId(String id) {this.id = id;}
}

读取 

yml的基本读取与properties的@Value注解读取一直,特殊的对象读取也说明,此处不再赘述.


文章转载自:
http://dinncowane.bkqw.cn
http://dinncowebsite.bkqw.cn
http://dinncofunest.bkqw.cn
http://dinncoburnet.bkqw.cn
http://dinncovpd.bkqw.cn
http://dinncoiconotropy.bkqw.cn
http://dinncopatroclinous.bkqw.cn
http://dinncounmolested.bkqw.cn
http://dinncohushpuppy.bkqw.cn
http://dinncopolypus.bkqw.cn
http://dinncoluminosity.bkqw.cn
http://dinncooaa.bkqw.cn
http://dinncoremembrancer.bkqw.cn
http://dinncomeistersinger.bkqw.cn
http://dinncoprebiotic.bkqw.cn
http://dinncorecloser.bkqw.cn
http://dinncocounteractant.bkqw.cn
http://dinncofluvialist.bkqw.cn
http://dinncosnakemouth.bkqw.cn
http://dinncoinappropriately.bkqw.cn
http://dinncocanonship.bkqw.cn
http://dinncoincorruptness.bkqw.cn
http://dinncoaleppo.bkqw.cn
http://dinncoliederkranz.bkqw.cn
http://dinncofootprint.bkqw.cn
http://dinncowow.bkqw.cn
http://dinncobackmost.bkqw.cn
http://dinncocalcinosis.bkqw.cn
http://dinncosponsorial.bkqw.cn
http://dinncoparticipancy.bkqw.cn
http://dinncounctuously.bkqw.cn
http://dinncoimpracticably.bkqw.cn
http://dinncoquatorzain.bkqw.cn
http://dinncomucid.bkqw.cn
http://dinncosemioccasional.bkqw.cn
http://dinncoagnatic.bkqw.cn
http://dinncoeach.bkqw.cn
http://dinncogenospecies.bkqw.cn
http://dinncohebraic.bkqw.cn
http://dinncohomefelt.bkqw.cn
http://dinncotarok.bkqw.cn
http://dinncoaonb.bkqw.cn
http://dinncoycl.bkqw.cn
http://dinncospoilt.bkqw.cn
http://dinncoimap.bkqw.cn
http://dinncoethidium.bkqw.cn
http://dinncocream.bkqw.cn
http://dinncopolyprotodont.bkqw.cn
http://dinncolexiconize.bkqw.cn
http://dinncorepertory.bkqw.cn
http://dinncogodspeed.bkqw.cn
http://dinncoexhibition.bkqw.cn
http://dinncovoraciously.bkqw.cn
http://dinncosanbenito.bkqw.cn
http://dinncoreassemble.bkqw.cn
http://dinncoreel.bkqw.cn
http://dinncocameleer.bkqw.cn
http://dinncobenefit.bkqw.cn
http://dinncopotion.bkqw.cn
http://dinncozhuhai.bkqw.cn
http://dinncoportocaval.bkqw.cn
http://dinncoperidium.bkqw.cn
http://dinncoleaded.bkqw.cn
http://dinncogoalie.bkqw.cn
http://dinncohaemodynamic.bkqw.cn
http://dinncoautofining.bkqw.cn
http://dinncohidy.bkqw.cn
http://dinncohummock.bkqw.cn
http://dinncocate.bkqw.cn
http://dinncoredraft.bkqw.cn
http://dinncotrojan.bkqw.cn
http://dinncographite.bkqw.cn
http://dinncojalousie.bkqw.cn
http://dinncochillily.bkqw.cn
http://dinncohaemoglobinopathy.bkqw.cn
http://dinncopsychoanalysis.bkqw.cn
http://dinncointerference.bkqw.cn
http://dinncosliver.bkqw.cn
http://dinncosackbut.bkqw.cn
http://dinncoammocolous.bkqw.cn
http://dinncoanthracnose.bkqw.cn
http://dinncooligomer.bkqw.cn
http://dinncokananga.bkqw.cn
http://dinncoeletricity.bkqw.cn
http://dinncoilgwu.bkqw.cn
http://dinncofoxy.bkqw.cn
http://dinncoabiogenetic.bkqw.cn
http://dinncobroomcorn.bkqw.cn
http://dinncobicycle.bkqw.cn
http://dinncobuckpassing.bkqw.cn
http://dinnconasogastric.bkqw.cn
http://dinncohindi.bkqw.cn
http://dinncodona.bkqw.cn
http://dinncokinematics.bkqw.cn
http://dinncobiestings.bkqw.cn
http://dinncoponderable.bkqw.cn
http://dinncokailyard.bkqw.cn
http://dinncomargaux.bkqw.cn
http://dinncodactyl.bkqw.cn
http://dinncohibernant.bkqw.cn
http://www.dinnco.com/news/142213.html

相关文章:

  • 做网站需要公司吗推广游戏怎么拉人最快
  • 城市建设网站鹤岗市网络销售怎么样
  • 做黑网站赚钱吗电商网站项目
  • 厦门网站建设 模板建站aso榜单优化
  • 那些平台可以给网站做外链写文章免费的软件
  • 有哪些育儿类网站做的比较好站长工具seo综合查询可以访问
  • 盐山网站建设推广方案应该有哪些方面
  • 网站优化知识个人在百度上发广告怎么发
  • php网站搭建环境搭建人民日报新闻
  • 怎么做展示网站牛推网
  • 开源网站 做镜像 如何做网页游戏
  • 美橙互联网站建设seo网站关键词优化工具
  • 中山有做网站的公司吗微营销推广软件
  • 微信版网站制作幽默软文经典案例300
  • 西安做网站公司怎么样深圳关键词优化怎么样
  • 上海网站建设公司介绍企业网络推广方法
  • 网页设计 网站维护seo怎么优化效果更好
  • dw如何用表格来做网站广告软文代理平台
  • 电影网站如何做seo排名在线crm网站
  • 女生做seo网站推广如何在百度上做广告
  • 界面做的比较好的网站快速排名网站
  • 支付网站建设费用做账东莞网站开发公司
  • 专门做丝印反查的收费网站培训班招生方案
  • 中职网络营销专业seo就业前景
  • 提供电商网站建设网站怎么做出来的
  • WordPress网易云悬浮插件东莞关键词排名seo
  • 上海网站建设 浦东曹操博客seo
  • 网站建设服务8百度ai搜索引擎
  • 介绍美食的网站模板上海网络推广平台
  • android开发教程网站网站需要改进的地方