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

怎样建立网站的快捷方式网站建设公司销售技巧

怎样建立网站的快捷方式,网站建设公司销售技巧,沈阳建设信息网,wordpress无法进入登录页这里写目录标题1、基本语法2、给java bean注入值3、测试1、基本语法 # yaml 配置文件写法#xff0c;代替properties写法 # 严格区分空格# 内注入到配置类中 server:port: 8081# 对象 student:name: jackage: 3# 行内写法 map student1: {name: jack, age: 3}# array or coll… 这里写目录标题1、基本语法2、给java bean注入值3、测试1、基本语法 # yaml 配置文件写法代替properties写法 # 严格区分空格# 内注入到配置类中 server:port: 8081# 对象 student:name: jackage: 3# 行内写法 map student1: {name: jack, age: 3}# array or collections pets:- dog- cat- turtlepets1: [dog, cat, turtle]# 还可以写随机数 或者 uuid uuid: ${random.uuid} random: ${random.int}2、给java bean注入值 核心 ConfigurationProperties(prefix person) // yaml 里面写person的属性 // 应用数据源配置..application.yaml # yaml 对象注入 dog:name: 八公age: 6person:person-name: abc163.com # bitqian_${random.uuid}happy: falsemaps: {k1: v1, k2: v2}age: ${random.int}hobbyList:- girl- code- bookdog:name: 拉布拉多age: 3server:port:8081# https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-external-config这里以dog和person实体类对各种数据类型说明dog 这里用了properties加载配置官方推荐ymal package cn.bitqian.entity;import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.PropertySource; import org.springframework.stereotype.Component;/*** author echo lovely* date 2020/9/26 21:45*/ Component // ConfigurationProperties(prefix dog) PropertySource(value classpath:application.properties) public class Dog {// value SPEL Value(${server.port})private String name;private Integer age;public Dog() {}public Dog(String name, Integer age) {this.name name;this.age age;}public String getName() {return name;}public void setName(String name) {this.name name;}public Integer getAge() {return age;}public void setAge(Integer age) {this.age age;}Overridepublic String toString() {return Dog{ name name \ , age age };} } person类 package cn.bitqian.entity;import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; import org.springframework.validation.annotation.Validated;import javax.validation.constraints.Email;import java.util.List; import java.util.Map;/*** author echo lovely* date 2020/9/26 21:46*/ Component // 对应前缀 ConfigurationProperties(prefix person) // setter/getter 与yaml对应 Validated // 数据校验 public class Person {Email(message 必须是邮箱格式)private String personName;private Boolean happy;private Integer age;private MapString, Object maps;private ListObject hobbyList;private Dog dog;public Person() {}public Person(String name, Boolean happy, Integer age,MapString, Object maps, ListObject hobbyList, Dog dog) {this.personName name;this.happy happy;this.age age;this.maps maps;this.hobbyList hobbyList;this.dog dog;}public String getPersonName() {return personName;}public void setPersonName(String personName) {this.personName personName;}public Boolean getHappy() {return happy;}public void setHappy(Boolean happy) {this.happy happy;}public Integer getAge() {return age;}public void setAge(Integer age) {this.age age;}public MapString, Object getMaps() {return maps;}public void setMaps(MapString, Object maps) {this.maps maps;}public ListObject getHobbyList() {return hobbyList;}public void setHobbyList(ListObject hobbyList) {this.hobbyList hobbyList;}public Dog getDog() {return dog;}public void setDog(Dog dog) {this.dog dog;}Overridepublic String toString() {return Person{ personName personName \ , happy happy , age age , maps maps , hobbyList hobbyList , dog dog };} } 3、测试 package cn.bitqian;import cn.bitqian.entity.Dog; import cn.bitqian.entity.Person; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest;import javax.annotation.Resource;SpringBootTest class Springboot02ApplicationTests {Resourceprivate Dog dog;AutowiredQualifier(value person)private Person person;Testvoid contextLoads() {System.out.println(dog);System.out.println(person);}} age是随机的intpersonName 做了邮箱验证
http://www.pierceye.com/news/680649/

相关文章:

  • 任丘网站制作公司pc网站制作公司
  • 惠州城乡规划建设局网站工程公司经营范围
  • 淮南服装网站建设地址巴彦淖尔网站建设公司
  • 如何让自己的网站被百度收录wordpress 悬浮网易云
  • 天津展示型网站建设外包腾讯云wordpress镜像
  • python做网站点登入没反映wordpress母公司
  • 中国建设培训网站查询系统地产项目网站建设ppt
  • 温州高端网站建设网站开发实验心得
  • 设计参考网站有哪些陕西省西安市事业单位招聘网
  • 月编程做网站wordpress需要调用缩略图
  • 做一份网站动态图多少钱网站托管服务公司
  • 宣传式网站营销型网站套餐
  • 建设网站如何优化关键词江门排名优化公司
  • 做教学的视频网站wordpress小工具推荐
  • 唯品会专门做特卖的网站保险行业网站模板
  • 电商类公司网站应该怎么搭建广州做网站公司哪家比较好
  • 企业网站实名认证时间怎样开通微信公众号
  • 怎么才能在百度上搜到自己的网站如何优化网站
  • 酒泉网站建设价格福清市建设局网站
  • 网站建设有几种厦门网站的建设
  • 沈阳网站外包通过法人姓名查企业
  • 建设网站的多少钱红色风格网站
  • 公司网站运营维护单位温州h5建站
  • 做网站想注册商标是哪一类网站上线具体流程
  • 如何让网站自适应屏幕北京做网站哪个公司好
  • 个人网站建设简历网站路径怎么做
  • 学做面包到什么网站企业网站都没的百度快照咋办
  • 手机网站建设视频教程安徽建站之星
  • 做网站专题页的字大小是多少购物商城排名
  • 门窗东莞网站建设技术支持海口快速建站模板