解决各浏览器向url中传中问参数的问题

http://www.javashuo.com/article/p-bqnmvgum-bn.htmlhtml

后台的处理代码java

public static String getUrlnewName( String oldName) {
		String newName = "";
		try {
			String agent = inv.getRequest().getHeader("USER-AGENT");
			if (null != agent) {
				boolean isMSIE = (StringUtils.isNotBlank(agent) && agent.indexOf("MSIE") != -1);
				if (-1 != agent.indexOf("Firefox")) {// Firefox
					newName = "=?UTF-8?B?" + (new String(Base64.encodeBase64(oldName.getBytes("UTF-8")))) + "?=";
				} else if (isMSIE) { // IE 9 以上版本
					newName = oldName;
				} else {
					newName = URLEncoder.encode(oldName, "UTF-8");
					newName = StringUtils.replace(newName, "+", "%20");// 替换空格
				}
			} else {
				newName = oldName;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return newName;
	}
相关文章
相关标签/搜索