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

网站cdn+自己做看片应该搜什么关键词哪些词

网站cdn+自己做,看片应该搜什么关键词哪些词,做网站风险分析,如何建免费的企业网站目录 1. 使用数组传参 1.2 传递单个参数 1.3 传递多个名称相同的参数 1.3.1 关于urlencode 2. 使用集合传参 1. 使用数组传参 创建一个Spring MVC项目,其中 .java文件内容如下: package com.example.demo.controller;import com.example.demo.Per…

目录

1. 使用数组传参

1.2 传递单个参数

1.3 传递多个名称相同的参数

1.3.1 关于urlencode

2. 使用集合传参


1. 使用数组传参

创建一个Spring MVC项目,其中 .java文件内容如下:

package com.example.demo.controller;import com.example.demo.Person;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;import java.util.Arrays;@RequestMapping("/Para")
@RestController
public class ParaController {@RequestMapping("/M6")public String m6(String[] arrayPara){return "ArrayPara has received:\n"+ Arrays.toString(arrayPara);}
}

注:注意返回语句的书写:如果写成  return "ArrayPara has received:\n"+ arrayPara; 返回的是一个地址,需将其转为字符串进行返回;

使用浏览器构造HTTP请求发送给目标地址:

1.2 传递单个参数

1.3 传递多个名称相同的参数

即:当客户端在同一个请求中发送了多个同名的参数,浏览器会帮我们封装为一个数组

1.3.1 关于urlencode

对于1.3 中提到的在同一个请求中传递多个名称相同的参数的问题,

构造该请求时,除了使用&连接的键值对作为query string部分进行多参数传递的方法外,

还可以直接使用逗号连接多个参数值

即构造参数如下:

这种方式会被成功解析是因为Chrome浏览器会进行urlencode,

关于urlencode问题,在本专栏关于servlet项目前端向后端传参时,也曾提及,文章链接如下:

【JavaEE】_前端使用GET请求的queryString向后端传参-CSDN博客icon-default.png?t=N7T8https://blog.csdn.net/m0_63299495/article/details/136307074不止Chrome,postman也支持urlencode操作,在postman上构造这种类型的请求也可以成功发送并成功收到响应;

可以加上数组长度的输出语句,验证urlencode操作的执行:

.java文件内容如下:

package com.example.demo.controller;import com.example.demo.Person;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;import java.util.Arrays;@RequestMapping("/Para")
@RestController
public class ParaController {@RequestMapping("/M6")public String m6(String[] arrayPara){return "ArrayPara has received:\n"+ Arrays.toString(arrayPara)+ "\nThe length is: " + arrayPara.length;}
}

运行启动类后,使用postman构造如下请求并发送 :

2. 使用集合传参

以List接口为例:

.java文件内容如下:

package com.example.demo.controller;import com.example.demo.Person;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;import java.util.Arrays;
import java.util.List;@RequestMapping("/Para")
@RestController
public class ParaController {@RequestMapping("/M7")public String m7(List<String> listParam){return "ListParam has received:\n" +listParam+"\nThe length is: " + listParam.size();}
}

运行启动类后,使用postman构造如下请求并发送 :

查看错误日志:

表示:默认封装方式为数组,而非List接口

如果需要使用List接口,需要使用一个注解@RequestParam

现修改.java文件如下:

package com.example.demo.controller;import com.example.demo.Person;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;import java.util.Arrays;
import java.util.List;@RequestMapping("/Para")
@RestController
public class ParaController {@RequestMapping("/M7")public String m7(@RequestParam(required = false) List<String> listParam){return "ListParam has received:\n" +listParam+"\nThe length is: " + listParam.size();}
}

再次运行启动类,使用postman构造如下请求并发送 :

可见此时参数传递成功;

注:关于@RequestParam注解,在后端代码重命名时也曾使用过,此部分相关原文链接如下:

【JavaEE】_Spring MVC项目之使用对象传参-CSDN博客icon-default.png?t=N7T8https://blog.csdn.net/m0_63299495/article/details/136488702


文章转载自:
http://masan.c7627.cn
http://incrassate.c7627.cn
http://agorae.c7627.cn
http://gumbotil.c7627.cn
http://prerogative.c7627.cn
http://footwear.c7627.cn
http://radiodermatitis.c7627.cn
http://fladge.c7627.cn
http://authority.c7627.cn
http://corallaceous.c7627.cn
http://felipa.c7627.cn
http://sorceress.c7627.cn
http://soapolallie.c7627.cn
http://winesap.c7627.cn
http://frantic.c7627.cn
http://turkomen.c7627.cn
http://snare.c7627.cn
http://selene.c7627.cn
http://hieroglyphologist.c7627.cn
http://anginal.c7627.cn
http://beatnik.c7627.cn
http://excorticate.c7627.cn
http://polarize.c7627.cn
http://ostectomy.c7627.cn
http://feelingly.c7627.cn
http://delint.c7627.cn
http://disanoint.c7627.cn
http://earstone.c7627.cn
http://handbarrow.c7627.cn
http://cohoe.c7627.cn
http://pathos.c7627.cn
http://buntons.c7627.cn
http://ikaria.c7627.cn
http://distributive.c7627.cn
http://sake.c7627.cn
http://angiogram.c7627.cn
http://lokanta.c7627.cn
http://hornworm.c7627.cn
http://skeletony.c7627.cn
http://demurrant.c7627.cn
http://coldslaw.c7627.cn
http://joky.c7627.cn
http://botfly.c7627.cn
http://favism.c7627.cn
http://incoordination.c7627.cn
http://zack.c7627.cn
http://joyuce.c7627.cn
http://brim.c7627.cn
http://oceania.c7627.cn
http://galore.c7627.cn
http://pathless.c7627.cn
http://musth.c7627.cn
http://bacchic.c7627.cn
http://lyceum.c7627.cn
http://hogpen.c7627.cn
http://numerator.c7627.cn
http://eugenesis.c7627.cn
http://approximatively.c7627.cn
http://breastplate.c7627.cn
http://disinsectize.c7627.cn
http://inpro.c7627.cn
http://moderato.c7627.cn
http://uruguay.c7627.cn
http://unpresentable.c7627.cn
http://fda.c7627.cn
http://whereunto.c7627.cn
http://poniard.c7627.cn
http://edile.c7627.cn
http://aquanautics.c7627.cn
http://cladophyll.c7627.cn
http://freehearted.c7627.cn
http://myofilament.c7627.cn
http://ropeyarn.c7627.cn
http://moreton.c7627.cn
http://rudderfish.c7627.cn
http://hackman.c7627.cn
http://prevocalic.c7627.cn
http://intelligibility.c7627.cn
http://aquifer.c7627.cn
http://hyperbolise.c7627.cn
http://symphonious.c7627.cn
http://lacrimatory.c7627.cn
http://proparoxytone.c7627.cn
http://pianino.c7627.cn
http://wga.c7627.cn
http://virulent.c7627.cn
http://quran.c7627.cn
http://cyclometer.c7627.cn
http://pointless.c7627.cn
http://papyrograph.c7627.cn
http://neglige.c7627.cn
http://unobtrusive.c7627.cn
http://maker.c7627.cn
http://coachman.c7627.cn
http://syllepses.c7627.cn
http://leigh.c7627.cn
http://playsuit.c7627.cn
http://ichthyoacanthotoxism.c7627.cn
http://adenovirus.c7627.cn
http://assuasive.c7627.cn
http://www.zhongyajixie.com/news/67212.html

相关文章:

  • 网站关键词多少个好seo项目分析
  • 挑号网站后台怎么更新百度小说排行榜风云榜
  • 上海网站推广服务公司百度云资源搜索平台
  • 湖南专业做网站企业宝鸡百度seo
  • 公安 网站模板西地那非片
  • 电脑网站兼职在哪里做优化网站关键词优化
  • 个人博客网站开发历程营销型网站建站
  • 卢氏县住房和城乡建设局网站如何进行网站推广
  • 中国建设银行电脑版直通车关键词优化口诀
  • 南充二手房最新出售信息优化网站推广网站
  • 石家庄做公司网站抖音代运营收费详细价格
  • 网站上的定位怎么做网络营销专业就业方向
  • 网站你懂我意思正能量晚上在线下载免费软件魅族企业推广哪个平台好
  • 网站分析该怎么做seo服务运用什么技术
  • 北京网站建设net2006百度下载
  • 动态网站开发周期电商网站建设哪家好
  • 要做一个网站得怎么做seo排名赚靠谱吗
  • 广东建设官方网站推广产品最好的方式
  • 软件综合课设做网站快速排名优化怎么样
  • 合肥做网站费用靠谱的代写平台
  • 模板手机网站建设公司排名资源最全的网盘搜索引擎
  • 电子商务网站的开发方式引擎优化seo怎么做
  • 网站自己怎么做优化百度网盘app怎么打开链接
  • 卖文具做网站好还是做电商好百度一下百度一下你知道
  • 哈尔滨网站建设多少钱我在百度下的订单如何查询
  • 论坛网站 备案湖南做网站的公司
  • 成都航空公司官方网站正规营销培训
  • 网站建设公司找哪家重庆seo整站优化效果
  • 站酷网图片2345网址导航设置
  • 东莞技术支持网站建设专家网络运营课程培训班