《Zuul网关》之解析获取multipart/form-data格式的参数
作者:互联网
1、方式一
通过HttpServletRequestWrapper实现参数解析获取。
HttpServletRequestWrapper httpServletRequestWrapper = (HttpServletRequestWrapper) request; String parameter1 = httpServletRequestWrapper.getRequest().getParameter("parameter1");
2、方式二
通过MultipartResolver实现解析获取参数。这种方式即可以获取文本参数也可以获取文件参数。
MultipartResolver resolver = new CommonsMultipartResolver(request.getSession().getServletContext()); MultipartHttpServletRequest multipartHttpServletRequest = resolver.resolveMultipart(request); String parameter1 = multipartHttpServletRequest.getParameter("parameter1");
标签:网关,parameter1,form,request,HttpServletRequestWrapper,获取,参数,Zuul,解析 来源: https://www.cnblogs.com/gavincoder/p/14223571.html