[英]Sending % through @RequestParam in Spring
How to send %
using @RequestParam
in Spring?如何在 Spring 中使用
@RequestParam
发送%
?
I'm calling the API by this URL: http://localhost:8080/springmvc/test?param1=%
我通过这个 URL 调用 API:
http://localhost:8080/springmvc/test?param1=%
But I'm not able to get the % in the API.但我无法获得 API 中的 %。 When I'm debugging, I'm getting
param1 = null
but I want to get the real character %
.当我调试时,我得到
param1 = null
但我想得到真正的字符%
。 How to get that?如何得到它?
This is my API:这是我的 API:
public List<Test> testParam(
@PathVariable("test") string test,
@RequestParam(value = "param1", required = false) string myParaml) {
...
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.