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

在哪个网站可以做试卷国外平面设计教程网站

在哪个网站可以做试卷,国外平面设计教程网站,上海环球金融中心简笔画,柳州住房和城乡建设厅网站一、创建及运行方式 1. 从官网导入#xff1a; 注意#xff1a;由于我的java版本是1.8#xff1b;所以选中了spring2.7.14#xff1b;如果你的java版本是9及以上#xff0c;选中spring3相关的同时Java 版本也要对应起来 2. 创建第一个get请求 创建Controller package及…一、创建及运行方式 1. 从官网导入 注意由于我的java版本是1.8所以选中了spring2.7.14如果你的java版本是9及以上选中spring3相关的同时Java 版本也要对应起来 2. 创建第一个get请求 创建Controller  package及类创建以下的代码 package com.example.aitestmini.controller;import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController;//与前端请求的类 RestController public class firstController {//需求get请求路径/first, 前端显示hello springbootGetMapping(/first)String first(){return Hello Spring!;// http://localhost:8080/first} }运行 运行AitestMiniApplication的run()方法 在浏览器访问http://localhost:8080/first应该是展示hello spring 8080端口被占用使用以下命令查看占用端口的pid lsof -i :8080 执行下面命令kill调进程 kill -9 pid 3. 打包 mvn package 执行以上命令会在target/目录下自动生成jar包 4. 运行方式 方式一 之前已经说过了执行run()方法 方式二 java -jar target/aitest-mini-0.0.1-SNAPSHOT.jar 运行以上命令jar是刚才打出来的jar包 方式三 mvn spring-boot:run 执行以上命令 二、端口管理 1. 常见端口实名方式 如果配置文件不声明端口默认按照80801. application.properties配置文件管理端口 server.port80812. application.yml配置文件管理端口 server:port: 80823. 运行命令声明端口 mvn clean package java -jar -Dserver.port8083 target/aitest-mini-0.0.1-SNAPSHOT.jar 2. 不同环境配置不同的端口 针对环境创建不同的配置文件 3. 运行不同环境端口的方式 1. application.properties管理spring.profiles.activedev2. application.yml管理 spring:profiles:active: dev3. 在pom文件管理profilesprofileiddev/idpropertiesprofilesActivedev/profilesActive/properties/profileprofileidqa/idpropertiesprofilesActiveqa/profilesActive/properties!-- 默认qa环境--activationactiveByDefaulttrue/activeByDefault/activation/profile/profiles添加上面的依赖在application.properties管理 spring.profiles.activeprofilesActive 三、Get请求Demo 1. 普通get请求的声明方式 1. 方法名前面使用GetMapping(/first) 2. 方法名前面使用RequestMapping(path /first,method RequestMethod.GET) RestController public class firstController {//需求get请求路径/first, 前端显示hello springboot // GetMapping(/first)RequestMapping(path /first,method RequestMethod.GET)String first(){return Hello Spring!;// http://localhost:8080/first} } 2. 带有参数的Get请求 需求 http://localhost:8081/topic/{id} 对应浏览器显示地址{id}为内容 // 如果不想写PathVariable(id)里面的id需要保证传入的id-sid RestController public class BaseGetWithIdController {GetMapping(/topic/{id})String getTopic(PathVariable(id) String tid){return 请求的id为 tid 的内容;} }3. 在queryParam拼接 需求http://localhost:8081/native?s{sid} 对应浏览器显示地址这是一个本国地址为{sid}的内容 GetMapping(/native)String getNative(RequestParam(s) String sid){return 这是一个本国地址为 sid 的内容!;} 升级 如果当s66打印不一样的内容 GetMapping(/native)String getNative(RequestParam(s) String sid){return 这是一个本国地址为 sid 的内容!;}GetMapping(path /native, params {s66})String getNative1(RequestParam(s) String sid){return 这是一个本国地址为 sid 的内容!getNative1;} 4. 在controller前面加RequestMapping(/t) 效果相当于全部的链接前面加了/t会被自动识别 代码 RequestMapping(path /first,method RequestMethod.GET)String first(){return Hello Spring!;// http://localhost:8080/first} 5. PathVariable参数非必填 //1. PathVariable(value did,required false)中的required默认是true可以设置为false //2. 声明完成之后, 对应的访问路径会有2中需在GetMapping里面说明value {/topic/{did}/u,/topic/u}GetMapping(value {/topic/{did}/u,/topic/u})String getTopic1(PathVariable(value did,required false) String topid,RequestParam(defaultValue 66) int sid){return 请求的id为 topid 的内容并且参数sid为 sid 的内容;}//http://localhost:8081/t/topic/99/u//http://localhost:8081/t/topic/u 6. RequestParam非必填及提供默认值 GetMapping(/top/{city}/{year})String getRUIWithPara(PathVariable int year,PathVariable String city,RequestParam(defaultValue GDP,required false) String desc,RequestParam(defaultValue 45666) int money){return { year }年{ city }人均{ desc }为{ money };} 1. desc非必填但是GetMapping的值只有一个因为desc的类型不是PathVariable 2. RequestParam(defaultValue GDP,required false) String desc说明RequestParam的required如果为false可以非必填
http://wiki.neutronadmin.com/news/149725/

相关文章:

  • 网站建设服务范围广州建立公司网站多少钱
  • 阳澄湖大闸蟹网站建设惠州网站制作专业
  • 有没有免费的企业网站建设福州网站设计哪家做的好
  • 驻马店做网站建设的公司网站代码组件
  • frontpage做网站怎么样企业型网站建设费用
  • 色块设计网站工程造价信息网官网登录
  • 怎么创建自己的网站2021年最新的网站
  • 洛阳做多屏合一网站wordpress电商平台
  • 公司建设网站费用属于什么费用东莞企业网站设计
  • 深圳网站外包公司网上商店的优势和缺陷
  • 购物网站类型昆明有网站的公司
  • 厦门 网站开发济宁北湖建设集团网站
  • 深圳网站建设哪家口碑好香精论坛
  • 兰州做网站客户山西省建设监理协会网站
  • 小米路由器3 做网站Wordpress怎么给图片加注引
  • 沈阳网站制作公司云蓝图福田搭建网站费用
  • 北京做网站哪个公司好wordpress 不带主题显示
  • 网站右侧二维码代码宝山宜昌网站建设
  • 网站建设需要注意哪些方面深圳龙岗有什么好玩的地方
  • 新网站建设信息在线建网址
  • 网站设计公司多少钱南京外包公司
  • 无形资产 网站建设seo引擎优化方案
  • 网站设计的公司蒙特温州建设诚信网站
  • 网站后台文章删了 怎么前台还有o2o商城网站开发
  • 网站的留言怎么做公司网站建设对公司的重要性
  • seo网站排名优化软件是什么有哪些做分析图用的网站
  • 制作网站的网站郑州最新通告
  • 模型下载网站开发流程个人网站有什么用
  • 企业网站的常见服务学校网站怎么做的好
  • 什么叫网站建设哪个网站可以做分期