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

龙井网站建设彩妆网站建设报告

龙井网站建设,彩妆网站建设报告,wordpress 做影视站,wordpress图片并排文章目录 一、概述1.1 简介1.2 起步依赖1.3 入门案例1.4 快速启动 二、基础配置2.1 三种配置文件方式2.2 yaml文件格式2.3 yaml读取数据方式#xff08;3种#xff09; 三、多环境开发3.1 yml文件-多环境开发3.2 properties文件-多环境开发3.3 多环境命令行启动参数设置3.4 多… 文章目录 一、概述1.1 简介1.2 起步依赖1.3 入门案例1.4 快速启动 二、基础配置2.1 三种配置文件方式2.2 yaml文件格式2.3 yaml读取数据方式3种 三、多环境开发3.1 yml文件-多环境开发3.2 properties文件-多环境开发3.3 多环境命令行启动参数设置3.4 多环境开发兼容问题maven与boot3.5 配置文件分级 四、基于SpringBoot整合SSM4.1 整合Junit4.2 整合Mybatis4.3 案例 一、概述 1.1 简介 1.2 起步依赖 1.3 入门案例 【springboot】Spring 官方抛弃了 Java 8新idea如何创建java8项目 1.4 快速启动 后端人员可以将项目打jar包交给前端人员通过dos指令操作运行后端程序和服务器方便前端人员设计界面而不用安装idea 注意下图红色部分1必须写以保证打包时具有springboot的Maven插件 二、基础配置 2.1 三种配置文件方式 配置文件建立在src/main/resources目录下。 SpringBoot加载配置文件的顺序application.propertirs application.yml application.yaml 如果自己建的配置文件没有自动提示功能可通过下述方法解决 2.2 yaml文件格式 2.3 yaml读取数据方式3种 application.yaml lesson: SpringBootserver:port: 80enterprise:name: itcastage: 16tel: 15922266subject:- Java- 前端- 大数据 Enterprise.class package com.itheima.domain;import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component;import java.util.Arrays;//封装yaml对象格式数据必须先声明当前实体类受Spring管控 Component //使用ConfigurationProperties注解定义当前实体类读取配置属性信息通过prefix属性设置读取哪个数据 ConfigurationProperties(prefix enterprise) public class Enterprise {private String name;private Integer age;private String tel;private String[] subject;Overridepublic String toString() {return Enterprise{ name name \ , age age , tel tel \ , subject Arrays.toString(subject) };}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;}public String getTel() {return tel;}public void setTel(String tel) {this.tel tel;}public String[] getSubject() {return subject;}public void setSubject(String[] subject) {this.subject subject;} } BookController.class package com.itheima.controller;import com.itheima.domain.Enterprise; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.core.env.Environment; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController;RestController RequestMapping(/books) public class BookController {Value(${lesson})private String lesson;Value(${server.port})private String port;Value(${enterprise.subject[0]})private String subject_0;Autowiredprivate Environment environment;Autowiredprivate Enterprise enterprise;GetMapping(/{id})public String getById(PathVariable Integer id){System.out.println(-----第一种方式:Value直接读取-------);System.out.println(lesson);System.out.println(port);System.out.println(subject_0);System.out.println(-----第二种方式:Envrionment封装后读取-------);System.out.println(environment.getProperty(enterprise.subject[1]));System.out.println(-----第三种方式:自定义实体类封装属性-------);System.out.println(enterprise);return hello , spring boot!;}} 注意自定义对象封装数据警告解决方案 !-- 自定义对象封装数据警告解决方案 --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-configuration-processor/artifactIdoptionaltrue/optional/dependency三、多环境开发 3.1 yml文件-多环境开发 #设置启用的环境 spring:profiles:active: test--- #开发 spring:config:activate:on-profile: dev server:port: 80 --- #生产 spring:profiles: pro server:port: 81 --- #测试 spring:profiles: test server:port: 82 --- 3.2 properties文件-多环境开发 3.3 多环境命令行启动参数设置 编写yml文件因为带有中文所以要设置字符集编码打包前clean一下关闭测试可选打包package去jar包的目录下启动cmd通过命令行配置启动环境java -jar 包名 --spring.profile.active环境名 也可以通过命令行改变端口号 3.4 多环境开发兼容问题maven与boot 3.5 配置文件分级 高级别配置文件会覆盖低级别配置文件解释 当我们在开发时在第4级别配置文件编写当项目提交时配置第3级别文件然后将项目打包如果需要临时修改配置文件无需重新打包直接在jar下配置第1或2级别配置文件可完成灵活配置 这里的file一般指的是打包后的目录即项目名/targetclasspath一般指的是类目录即项目名src/main/resources/ 四、基于SpringBoot整合SSM 4.1 整合Junit 4.2 整合Mybatis 4.3 案例
http://www.zqtcl.cn/news/544746/

相关文章:

  • 河北黄骅市网站建设网站外链的优化方法
  • 青岛城阳网站制作网站建设详细步骤
  • 先做网站再付款 怎么回答设计方案步骤
  • 汕头建站模板济南网站建设富库网络
  • 创业网站建设方案项目书手机app设计软件
  • 建设端午节网站的目的主题wordpress语法高亮插件
  • 做网站开发使用百分比的好处深圳建设网站公司简介
  • 行距网站上海专业网站建设机构
  • 闵行手机网站建设鲅鱼圈规划建设局网站
  • 合肥市城乡和建设网站网页设计与网站建设区别
  • 青岛网站建设企业建站北京网站模仿
  • 广州建设网站的公司简介湛江建设厅网站
  • 做网站不赚钱了网站关键词排行查询
  • 印度人通过什么网站做国际贸易三门峡做网站
  • 网站排名快速提升工具招远建网站首选公司
  • 手机网站格式商城网游开发公司
  • 手机怎样创建网站长春网站建设哪家专业
  • 做pop网站定制开发教程
  • 成都响应式网站建报告问题
  • 做设计找素材的+网站有哪些建立平台什么意思
  • 网站设置在哪里找宁德网站建设制作
  • logo网站设计素材品牌高端网站建设公司
  • 芙蓉区乡建设局网站郑州网站建设qicaizz
  • 网站建设的缺陷个人网站制作图片
  • 四川省建设厅注册管理中心网站设计上海2021门票
  • 帝国cms做微网站人力资源公司怎么开
  • 网站建设学徒松江品划做网站公司
  • 灯饰网站需要这么做深圳专业网站设计公司
  • 政务网站设计wordpress 嵌入html5
  • 移动网站 pc网站的区别吗网站建设工厂