Java 理解Spring引导代码流时遇到问题
我有一个如下的spring引导代码,它处理如下的特定映射-Java 理解Spring引导代码流时遇到问题,java,spring,debugging,spring-boot,program-flow,Java,Spring,Debugging,Spring Boot,Program Flow,我有一个如下的spring引导代码,它处理如下的特定映射- @RestController @ResponseBody public class SomeAPIController { @RequestMapping( value = "/some-api", method = RequestMethod.GET, produces = {"application/json", "application/xml"}
@RestController
@ResponseBody
public class SomeAPIController {
@RequestMapping(
value = "/some-api",
method = RequestMethod.GET,
produces = {"application/json", "application/xml"}
)
@ResponseStatus(HttpStatus.OK)
@ResponseBody
public SomeAPIPayload validateAPIUpdate(
@Valid @RequestParam(value = "query", defaultValue="") String queryString
)
但在上面的代码中,如果我将查询作为“something”
传递,它工作正常,但是如果我传递,比如说,“#something”
,它将无法查询(我通过打印queryString
值来验证它,结果是空的),因此,就我的理解而言@Valid
(从javax.validation导入)正在进行一些验证,并且没有让“#某物”
通过。我想知道如何追踪验证文件,或者如果有其他错误,如何找到它?
任何指向方向的指针都将非常有用
谢谢。散列(#
)之后的所有内容都被解释为锚点/片段,不会按照RFC 1738中的说明发送到服务器。
要发送散列符号,您需要将其编码为%23
散列(#
)之后的所有内容都解释为锚点/片段,不会按照RFC 1738中的说明发送到服务器。
要发送散列符号,您需要将其编码为%23
#
中的URL
代表一个。因此,如果您的查询是http://example.com?query=#something
然后#something
部分被视为片段标识符,而查询
参数为空。URL中的#
代表片段标识符。因此,如果您的查询是http://example.com?query=#something
然后将#something
部分视为片段标识符,而查询
参数为空。%23
我认为可以代替#23
:P@Vimal好地方。%23
我想代替\23
:P@Vimal好地方。