之前采用其他的方法,发现IE下的解决方案不适用于FirFox等,适用FirFox的方案又不适用于IE,所以找到一个两者都适用的解决方法真不容易;
此方法,只适用于Spring框架的原因,是框架帮助解码一次;
前台
url: contextPath + "/getalltimes2.do?type='" + escape(encodeURI("演讲")) + "'",
两次编码
后台
public List<TestTime> getAllTestTimes2(String type) throws UnsupportedEncodingException {
type = URLDecoder.decode(type, "utf-8");
.....
}
只需解码一次,大功告成。