request.setCharacterEncoding("UTF-8"); //java代码中这样设置一下,将请求编码改为utf-8,但是只对post方式有效
String path= request.getParameter("documentPath"); //得到传过来的中文参数
String method = request.getMethod(); //获取提交方式
if(method!=null && "GET".equals(method)){ //如果是get的方式的话
path= new String(path.getBytes("ISO8859-1"), "UTF-8"); //(这里的UTF-8取决于jsp页面的编码)这样得到的path就不会是乱码了
String path= request.getParameter("documentPath"); //得到传过来的中文参数
String method = request.getMethod(); //获取提交方式
if(method!=null && "GET".equals(method)){ //如果是get的方式的话
path= new String(path.getBytes("ISO8859-1"), "UTF-8"); //(这里的UTF-8取决于jsp页面的编码)这样得到的path就不会是乱码了