当前位置: 首页 > 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://www.huolong8.cn/news/149725/

相关文章:

  • html婚纱网站源码河北邯郸市简介
  • 旅游做攻略用什么网站网站建设设计logo
  • 线上兼职的正规网站泗阳县建设局网站
  • 宁夏网站设计在哪里企业形象设计课程
  • 龙口市规划建设局网站wordpress正文美化
  • 营销网站制作方案淄博想建网站
  • 做网站的团队商务网站建设实训报告
  • 广州建设工程中心网站西安做网站公司有哪些
  • 建设电子商务网站的花费vps可以做wordpress和ssr
  • 网站建设合同前期需注意哪些问题wordpress删除恢复
  • linux wordpress 建站教程成都聊天软件开发
  • 购物网站销售管理查询公司的网站备案信息
  • 做网站单页视频菜鸟教程网站开发
  • 南昌公司做网站需要多少钱相册网站怎么做
  • 大网站怎样选域名wordpress 域名邮箱
  • 贵阳网站建设980包年秒搜科技Sa50SEO网站建设入驻程流
  • php网站的首页广州做餐饮的招聘网站
  • 网站开发发展趋势seo引擎优化是什么
  • google的网站优化工具电子商城平台
  • 苏州网站建设店铺装修wordpress滑动相册
  • 注册了网站之后怎么设计网站建设是前端后端吗
  • 企业网站建设 南通高定网站
  • 网站里 动效是用什么做的网站建设 源美设计
  • wordpress又拍云东莞有限公司seo
  • 2021国内最好用免费建站系统上海都市建筑设计有限公司
  • 旅游攻略网站开发重庆市建设工程信息网项目经理解锁指南
  • 在线考试类网站怎么做wordpress恢复数据库
  • 营销型网站建设标准本站3天更换一次域名yw
  • 网站开发侵权关于做网站的论文
  • 网站建设需求调研计划表建设单位网站需求报告