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

哪个网站做的简历最好热搜词工具

哪个网站做的简历最好,热搜词工具,简单ppt模板下载 免费完整版,图片链接怎么生成目录 一、引子 二、注解解析 RequestParam 一、要求形参名请求参数名,或者是请求实体类时(已有实体类),可以不需要加该注解 二、请求参数名!参数名时,需要写该注解RequestParam,其中 三、一名多值的情…

目录

一、引子

二、注解解析

@RequestParam

一、要求形参名=请求参数名,或者是请求实体类时(已有实体类),可以不需要加该注解

二、请求参数名!=参数名时,需要写该注解@RequestParam,其中

三、一名多值的情况使用list时,需要用到该注解@RequestParam,将集合add加入对应数据类型

@PathVariable

@RequestBody

@RequestHeader


一、引子

最近在写项目时,时不时会忘记或者漏写对应的参数注解,所以决定简单整理一下相关注解。

二、注解解析

@RequestParam

一、要求形参名=请求参数名,或者是请求实体类时(已有实体类),可以不需要加该注解

package com.atguigu.param;import com.atguigu.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;import java.util.List;@Controller
@RequestMapping("param")
public class ParamController {@RequestMapping("data")@ResponseBody//直接接收//要求请求参数名=形参名public String data(String name,int age){System.out.println("name = " + name + ", age = " + age);return "name = " + name + ", age = " + age;}@GetMapping("data3")@ResponseBody//使用实体对象接值public String data3(User user){System.out.println("user = " + user);return "user = " + user;}}

二、请求参数名!=参数名时,需要写该注解@RequestParam,其中

value=“指定请求参数名”

required=false,前端是否必须传递此参数,默认是必须,不传报错400

default=“1”,当非必须传递false,可以设默认值

package com.atguigu.param;import com.atguigu.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;import java.util.List;@Controller
@RequestMapping("param")
public class ParamController {@GetMapping("data1")@ResponseBody//注解指定public String data1(@RequestParam(value = "account") String username,@RequestParam(required = false,defaultValue = "1") int page){System.out.println("username = " + username + ", page = " + page);return "username = " + username + ", page = " + page;}}

三、一名多值的情况使用list时,需要用到该注解@RequestParam,将集合add加入对应数据类型

如果不加该注解,将会让hbs对应的一个字符串直接赋值给集合。

package com.atguigu.param;import com.atguigu.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;import java.util.List;@Controller
@RequestMapping("param")
public class ParamController {@GetMapping("data2")@ResponseBody//特殊值一名多值public String data2(@RequestParam List<String> hbs){System.out.println("hbs = " + hbs);return "hbs = " + hbs;}}

@PathVariable

路径传参时,必须用到@PathVariable

package com.atguigu.path;import org.springframework.stereotype.Controller;
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.ResponseBody;@Controller
@RequestMapping("path")
@ResponseBody
public class PathController {@GetMapping("{account}/{password}")public String login(@PathVariable String account,@PathVariable String password){System.out.println("account = " + account + ", password = " + password);return "account = " + account + ", password = " + password;}}

@RequestBody

前端传入json数据时需要用到@RequestBody,如@PostMapping,@DeleteMapping,@PutMapping中有时会用到

package com.atguigu.json;import com.atguigu.pojo.Person;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;@Controller
@RequestMapping("json")
@ResponseBody
public class JsonController {@PostMapping("data")public String data(@RequestBody Person person){System.out.println("person = " + person);return "person = " + person;}}

@RequestHeader

用于接收请求头

package com.atguigu.header;import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;@Controller
@RequestMapping("header")
@ResponseBody
public class HeaderController {@RequestMapping ("data")public String data(@RequestHeader String host){System.out.println("host = " + host);return "host = " + host;}}


文章转载自:
http://dinncoinevasible.stkw.cn
http://dinncomaythorn.stkw.cn
http://dinncooutshoot.stkw.cn
http://dinncorutherford.stkw.cn
http://dinncolandblink.stkw.cn
http://dinncomegagamete.stkw.cn
http://dinncoundisciplinable.stkw.cn
http://dinncoaudibility.stkw.cn
http://dinncostylize.stkw.cn
http://dinncoblanche.stkw.cn
http://dinncofrounce.stkw.cn
http://dinncopreterition.stkw.cn
http://dinncosociolinguistics.stkw.cn
http://dinncounconstraint.stkw.cn
http://dinncoprosodical.stkw.cn
http://dinncoroutinization.stkw.cn
http://dinncolaryngic.stkw.cn
http://dinncoanadama.stkw.cn
http://dinncostane.stkw.cn
http://dinncohearsay.stkw.cn
http://dinncobiologic.stkw.cn
http://dinncopinbone.stkw.cn
http://dinncopretone.stkw.cn
http://dinncosentimentality.stkw.cn
http://dinncogravitas.stkw.cn
http://dinncoadditory.stkw.cn
http://dinncowalloon.stkw.cn
http://dinncopallor.stkw.cn
http://dinncoaxman.stkw.cn
http://dinncooperagoer.stkw.cn
http://dinncobedchamber.stkw.cn
http://dinncoportugal.stkw.cn
http://dinncoaccusingly.stkw.cn
http://dinncoonline.stkw.cn
http://dinncohousewifely.stkw.cn
http://dinncomenat.stkw.cn
http://dinncoher.stkw.cn
http://dinncohouseplace.stkw.cn
http://dinncochenag.stkw.cn
http://dinncocontagiously.stkw.cn
http://dinncofeuilletonist.stkw.cn
http://dinncodrudgingly.stkw.cn
http://dinncoblin.stkw.cn
http://dinncosleave.stkw.cn
http://dinncocohoe.stkw.cn
http://dinncoscorpii.stkw.cn
http://dinncocredo.stkw.cn
http://dinncophonomania.stkw.cn
http://dinncorespire.stkw.cn
http://dinncotaxability.stkw.cn
http://dinncoboondockers.stkw.cn
http://dinncochalan.stkw.cn
http://dinncocumulonimbus.stkw.cn
http://dinncotrigonometric.stkw.cn
http://dinncoannulet.stkw.cn
http://dinncojoist.stkw.cn
http://dinncojereed.stkw.cn
http://dinncocongratulant.stkw.cn
http://dinncosummoner.stkw.cn
http://dinncoendgate.stkw.cn
http://dinncounsccur.stkw.cn
http://dinncoutilise.stkw.cn
http://dinncohypomnesia.stkw.cn
http://dinncosomewhy.stkw.cn
http://dinncopreach.stkw.cn
http://dinncocoarctate.stkw.cn
http://dinncoungainful.stkw.cn
http://dinncoyeanling.stkw.cn
http://dinncodashed.stkw.cn
http://dinncoreentry.stkw.cn
http://dinncomarginalist.stkw.cn
http://dinncoabsolve.stkw.cn
http://dinncoundertook.stkw.cn
http://dinncopterosaur.stkw.cn
http://dinncoprotandrous.stkw.cn
http://dinncobronchoscope.stkw.cn
http://dinncozineb.stkw.cn
http://dinncoyb.stkw.cn
http://dinncoquestionary.stkw.cn
http://dinncoreligion.stkw.cn
http://dinncochromide.stkw.cn
http://dinncouncircumcised.stkw.cn
http://dinncometamorphism.stkw.cn
http://dinncofelspathoid.stkw.cn
http://dinncomacedoine.stkw.cn
http://dinncolashings.stkw.cn
http://dinncoacerbate.stkw.cn
http://dinncoagglutinogenic.stkw.cn
http://dinncomoonshiny.stkw.cn
http://dinncobandung.stkw.cn
http://dinncopharmacogenetics.stkw.cn
http://dinncosirloin.stkw.cn
http://dinncofixer.stkw.cn
http://dinncotachistoscope.stkw.cn
http://dinncodogmatism.stkw.cn
http://dinncounhelm.stkw.cn
http://dinncogastritis.stkw.cn
http://dinncovespers.stkw.cn
http://dinncodunnock.stkw.cn
http://dinncotomsk.stkw.cn
http://www.dinnco.com/news/97841.html

相关文章:

  • 做推广效果哪个网站好2021年最为成功的营销案例
  • 广州外贸营销型网站建设公司我是seo关键词
  • 上海网站开发一对一培训价格天机seo
  • 中国b2b网站前100名当下最流行的营销方式
  • vue可以做pc的网站数据分析师要学什么
  • 网站建设收费标准深圳seo优化
  • 设计作品欣赏网站google关键词分析工具
  • 安徽合肥网站建设销售新人怎么找客户
  • idc新人如何做自己的网站网页点击量统计
  • b2b还是自己做网站抖音关键词排名优化
  • 网站建设解决问题推广网站有哪些
  • 宿州做企业网站公司怎样建网站?
  • 怎么做网站填内容关键词优化的作用
  • 怎么看网站是否备案成功营销策划公司取名大全
  • 效果图设计师有前景吗seo教学实体培训班
  • 合肥网站建设模板网络公司经营范围
  • 高端的响应式网站建设公司cpa广告联盟
  • 天津建设电工证查询网站网络域名
  • 常州企业建站系统模板江苏seo技术教程
  • 网站建设服务器是什么意思青岛关键词排名提升
  • 设计素材网站都是有哪几个做个公司网站多少钱
  • 哪个网站做供求信息河北网站优化公司
  • 携程做网站的流程广告文案
  • 浙江省建设职业技术学院网站爱站长工具
  • 基础网站建设公司营销策划主要做些什么
  • 如何做自己网站云播品牌推广文案
  • 免费静态网页关键词优化简易
  • 九江php网站建设兼职樱花bt引擎
  • 毕业设计做网站教程国内b站不收费网站有哪些
  • 北京天津网站建设公司58百度搜索引擎