response.sendRedirect重定向中文传参

原博地址:
https://332590882-qq-com.iteye.com/blog/2311055

.传参:
classname = URLEncoder.encode(classname,“gb2312”);
转码后-----%B5%E7%D0%C510103(电信10103)

	//response.sendRedirect重定向中文传参
	String classname = student.getclassname();
	classname = URLEncoder.encode(classname,"gb2312");
	response.sendRedirect("/Student/FindAllStudent.action?classname="+classname);

取参:电信10103

String classname = new String(request.getParameter("classname").getBytes("iso-8859-1")); 

.jsp,a标签传参:

${cla.classname}

Controller层取参:

String classname = new String(request.getParameter("classname").getBytes("iso-8859-1"),"utf-8");

你可能感兴趣的:(崩溃的我)