版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zy1471162851/article/details/90175154
tip:在过滤器中 去除map 对象中属性有空的字符串
Map map =req.getParameterMap();
Map trim = new HashMap();
/**
* 参数去空
* */
for (Object set :map.keySet() ) {
String[] s = (String[]) map.get(set);
trim.put(set,String.valueOf(s[0]).trim());
}
ParameterRequestWrapper requestWrapper = new ParameterRequestWrapper((HttpServletRequest)req, trim);