请求地址:/search/冒险.html
在Action里获取时,是乱码“??”
String keyword = null == request.getParameter("keyword") ? "" : request.getParameter("keyword");
keyword = new String(keyword .getBytes("ISO-8859-1"),"utf-8");
这里的keyword打印出来是"??",请问这是什么问题啊,怎么解决啊!
在Action里获取时,是乱码“??”
String keyword = null == request.getParameter("keyword") ? "" : request.getParameter("keyword");
keyword = new String(keyword .getBytes("ISO-8859-1"),"utf-8");
这里的keyword打印出来是"??",请问这是什么问题啊,怎么解决啊!
修改成location.href = encodeURI(""/search/冒险.html");
还不行就看看Web容器的server.xml文件中找到Connector节点、加上编码 URIEncoding="UTF-8"<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8"/>
加了,Connector节点也加了URIEncoding="UTF-8",结果还是乱码!和之前是一样的!