我正在尝试通过发布请求将数据传递到控制器,但是ec2-xx-xxx-xx-xxx.us-east-2.compute.amazonaws.com/?a=10&hs=True
从值中剥离了。我已经尝试过#
和HttpRequestUtil.getParametersMap(request)
,但似乎都在剥离@RequestParam("param")
#
当我使用如下形式发布此方法时:
@RequestMapping(value = "/submit", method = RequestMethod.POST)
public String handlerReceiptSinglePost(@RequestParam("bill_to_address_line2") final String billingLine2, final HttpServletRequest request, final Model model)
{
LOG.info(billingLine2);
}
我在日志中得到了
<form action="/submit" method="POST">
<input name="bill_to_address_line2" value="#4"/>
</form>
春季是否有任何配置会导致这种情况?还是我应该检查以进一步解决问题的任何内容?
答案 0 :(得分:0)
request.setCharacterEncoding("UTF-8");
使用编码的请求在帖子值上支持特殊字符 检查这个博客 https://www.programcreek.com/java-api-examples/?class=javax.servlet.http.HttpServletRequest&method=setCharacterEncoding