Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring @RequestParam值转换为小写_Spring_Spring Mvc_Spring Boot_Spring Test Mvc - Fatal编程技术网

Spring @RequestParam值转换为小写

Spring @RequestParam值转换为小写,spring,spring-mvc,spring-boot,spring-test-mvc,Spring,Spring Mvc,Spring Boot,Spring Test Mvc,我有一个简单的控制器,其中包含一个请求参数,如: @RequestParam(required = false) String name 现在,我还有一个mockmvc测试,包含: mockMvc.perform(get("/rest/hello/greet") .param("name", "Marcel")) 在日志记录中,我看到请求参数似乎已正确传递: MockHttpServletRequest: HTTP Method = GET Request URI = /re

我有一个简单的控制器,其中包含一个请求参数,如:

@RequestParam(required = false) String name
现在,我还有一个mockmvc测试,包含:

mockMvc.perform(get("/rest/hello/greet")
    .param("name", "Marcel"))
在日志记录中,我看到请求参数似乎已正确传递:

MockHttpServletRequest:
  HTTP Method = GET
  Request URI = /rest/hello/greet
   Parameters = {name=[Marcel]}
然而,在我的控制器中,请求参数是小写的

@Get(path = "/greet", produces = APPLICATION_JSON_VALUE)
public ResponseEntity<JSONObject> greet(@RequestParam(required = false) String name) {
    logger.info("greet called with name: {}", name);
@Get(path=“/greet”,products=APPLICATION\u JSON\u VALUE)
公共响应性问候(@RequestParam(required=false)字符串名){
info(“用名称{},name调用的问候语);
它打印名为marcel的问候语。 此外,很明显,当将此参数传递给其他服务时,它是以小写形式传递的


这是一个非常简单的Spring Boot应用程序,所以我想知道为什么这个请求参数是小写的。

发现了导致这个问题的应用程序上下文中的某个
转换器的问题。

检查servlet过滤器或控制器方法周围的一些AOP。