HTTP协议传参时,以UTF-8解析
/**
* HTTP协议传参时,以UTF-8解析
*
* @param name the name
* @param request the request
* @return par 8
*/
public static String getPar8(String name, HttpServletRequest request) {
String val = CourtUtils.trim(request.getParameter(name));
try {
if (val == null || "null".equals(val)) {
val = "";
} else {
val = java.net.URLDecoder.decode(val, "UTF-8");
}
} catch (UnsupportedEncodingException e) {
Logger.error(e.getMessage(), e);
val = "";
}
return val;
}